On Saturday 29 November 2008 06:45, Stephen C. Gilardi wrote:
> On Nov 29, 2008, at 9:30 AM, Randall R Schulz wrote:
> > Is it a reader bug? (That the second apostrophe appeared to be
> > ignored.)
>
> It wasn't ignored. It quoted the string.

Yeah, Robert made me see that.


> I've been interested in a way to see what the reader returns for
> things like this in the past.
>
> It turns out we can get that using macroexpand:
>
> user=> (prn (macroexpand '(interpose '.' "The quick brown fox")))
> (interpose (quote .) (quote "The quick brown fox"))
>
> (I hadn't thought of macroexpand expanding reader macros as well as
> non-reader macros, but that's the effect here.)

I think the reader is doing "expanding" on reader macros. Macro-expand 
is just nilpotent when no macros are in play.

In this case, it's no different than just printing the list you passed 
to macroexpand:

user=> '(interpose '.' "The quick brown fox")
(interpose (quote .) (quote "The quick brown fox"))


It's a good technique, though, to see what the compiler is going to be 
asked to translate after all players between the form as submitted and 
the compiler have done their thing.


> --Steve


Randall Schulz

--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to