On Tue 21 Jan 2014 at 07:33:43PM -0800, Alejandro Ciniglio wrote:

> I was wondering if people had advice on when to write these sorts of
> macros vs. when to just use the trivial expansion in the code? (Or
> alternatively, what am I missing in this macro definition?)
>
> (defmacro go-loop
>   "Like (go (loop ...))"
>   [bindings & body]
>   `(go (loop ~bindings ~@body)))

go-loop needs to be a macro to capture the unevaluated let bindings:

    (go-loop [i 0] …)

If go-loop were a function, this code would throw an error because i is
undefined.

    guns

Attachment: pgpV9FBLIxrCe.pgp
Description: PGP signature

Reply via email to