On Aug 14, 2009, at 2:03 AM, Chouser <chou...@gmail.com> wrote:
>
>
> On Aug 14, 2009, at 12:48 AM, Daniel Lyons <fus...@storytotell.org>
> wrote:
>
>>
>>
>> On Aug 13, 2009, at 5:30 PM, Bradbev wrote:
>>
>>>>> More complex "reader" macros could be (infix x + y + z / 3).
>>>>
>>>> I think you can already do that with regular macros.
>>>
>>> I don't think so. Macros are invoked after the read stage but
>>> before
>>> evaluation of arguments. This kind of macro would be invoked
>>> without
>>> the text going through any kind of reader expansion.
>>
>>
>> Isn't reader expansion exactly what you don't want?
>>
>> user> (defmacro infix [& args]
>> `(quote ~args))
>> #'user/infix
>> user> (infix 3 + 4 * 7)
>> (3 + 4 * 7)
>>
>> I don't understand what's stopping anyone from implementing the body
>> of that macro to make it actually implement infix arithmetic.
>
> That particular example may not have to be a macro at all:
>
> http://paste.lisp.org/display/75230
>
> I think people want reader macros for a couple different reasons.
> Sometimes it's just to remove parens from a function or macro call."
(sorry, finger slipped on the send button)
Another rather different reason is to implement features that would
otherwise require manually escaped strings as was mentioned earlier.
Perhaps these different desires can fulfilled with two different
constructs.
--Chouser
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---