On 9 dec, 17:03, Jeff Dik <s45...@gmail.com> wrote:
> The part "Running code at read-time lets users reprogram Lisp's
> syntax" caught my attention.  Is this talking about reader macros?  I
> believe I read that clojure doesn't have reader macros, so would it be
> more accurate to say "The whole language is there, _most_ of the
> time"?

Clojure doesn't have user-implementable reader macros, but neither
does emacs lisp. Reader macros are nice when you need to embed a
significantly different looking kind of language - that's why clojure
implements regular expressions as a reader macro instead of a function
on a string; you'd have to doubly escape every backslash otherwise.
But they're mostly "only" a way to provide syntactic sugar.

I think what Paul is +mainly+ talking about in terms of "syntax" is
just plain ordinary macros that can implement short-circuiting and
different evalution strategies for readable data, so that you can
implement things like (unless ...) yourself, with no (significant)
overhead compared to the built in (if), but you'll have to keep to the
basic reader constructs (but not evalution rules). This has the
advantage of keeping the language simpler to parse and readble for
humans too.

The other part of the "always there" is that you can use whatever is
already compiled/parsed to construct new macros, so you can build
macros on top of each other, and on top of a mix of macros and (user-
defined) functions instead of being restricted to the "traditional"
sparseness of C preprocessor macros.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to