On Sat, Jul 16, 2016 at 2:48 PM, Alexis King <lexi.lam...@gmail.com> wrote:
> Of course, this makes sense, given that macros operate entirely at
> compile-time. What you really want here is a function, not a macro. You
> can write a simple function that will accept a procedure or a string and
> will produce a procedure:
>[...]
>
> In fact, throws can be implemented as a function as well, [...example...]
>
> Generally, prefer functions over macros when functions will do.
> Functions are both more flexible (they can be used as values, and
> therefore can be used higher-order) and more predictable (function
> invocations have very predictable evaluation semantics, while macros
> might not).

Makes sense; thank you.

So, if one should prefer functions, what is a good place to use
macros?  When people talk about why LISP/Scheme/Racket are the most
powerful languages, they inevitably mention macros and continuations.
What is a good use case for macros?

Dave

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to