2 ms·
I don't know Clojure, but here's a couple of good macro examples in Scheme. Scheme's SRFI-41[0] implements Streams, which are lazily evaluated lists. A few ma
by davexunit 13y ago
I don't know Clojure, but here's a couple of good macro examples in Scheme.
Scheme's SRFI-41[0] implements Streams, which are lazily evaluated lists. A few macros are used in order to introduce lazy evaluation to the language. The Streams API wouldn't be very nice at all if no macros were used.
How about something more basic like the `let` macro? It's something you can't live without.
Whenever you need to control the order of evaluation, macros are what you want. Don't be wary of them. They are wonderful.
[0] http://srfi.schemers.org/srfi-41/srfi-41.html http://srfi.schemers.org/srfi-41/srfi-41.html