help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are there any problems with lexical-let or other cl-macros???


From: Pascal J. Bourguignon
Subject: Re: Are there any problems with lexical-let or other cl-macros???
Date: Wed, 08 Dec 2010 15:11:11 -0000
User-agent: Gnus/5.101 (Gnus v5.10.10) Emacs/23.1 (darwin)

Helmut Eller <eller.helmut@gmail.com> writes:

> * LanX [2010-06-01 17:58+0200] writes:
>
>> (please correct me if I don't get it right in my words)
>>
>> So defmacro is restricted to defining macros with "function syntax" -
>> ie "(macro ...)" -  while reader macros could be triggered by any
>> character, opening the possibility to even extend the syntax to have
>> special markup for different data structures?
>
> Yes right.  defmacro defines a transformation from s-exps to s-exps.  A
> reader macro reads text from a stream and returns an s-exp.
>
>> Interesting... :)
>
> Reader macros have been used to write inline XML, SQL, and of course
> Python or C like syntaxes, but the problem is that the editor (usually
> Emacs) doesn't know how to indent reader macros.  Also the read table
> (the data structure which controls the reader) must be set up properly
> before compiling; that complicates the build process and interaction
> with other tools like the debugger.  It's sometimes useful to parse data
> files, but I never use reader macros in source files.

That's just because your source programs have always dealt only with
standard lisp objects.

If you started to  write a lisp program that would have  to deal a lot
with higher-level  data types (ie.  problem oriented data  types), and
you'd  need  to write  often  literals of  that  type,  you would  use
profitably reader macros then.

-- 
__Pascal Bourguignon__
http://www.informatimago.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]