emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SUSPECTED SPAM] Re: `thunk-let'?


From: Stefan Monnier
Subject: Re: [SUSPECTED SPAM] Re: `thunk-let'?
Date: Wed, 08 Nov 2017 13:02:59 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> +  (cl-callf2 mapcar
> +      (lambda (binding)
> +        (pcase binding
> +          ((or (and (pred symbolp) s)
> +               `(,(and (pred symbolp) s)))
> +           `(,s nil))
> +          (`(,(pred symbolp) ,_) binding)
> +          (_ (signal 'error (cons "Bad binding in lazy-let"
> +                                  (list binding))))))
> +      bindings)

I think lazily binding a variable to nil is useless, so I'd drop the
first pcase branch above.

> +   :initial-value `(progn ,@body)))

You can use `macroexp-progn` to avoid constructing a `progn` in the
common case where body is already a single expression.

> +;;;###autoload
>  (defmacro thunk-delay (&rest body)

Maybe a better option is to add a `require` in the expansion of lazy-let?


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]