Explanation of macros; Haskell macros

Roman Belenov Roman.Belenov at intel.com
Fri Oct 31 04:10:18 EST 2003


Joachim Durchholz <joachim.durchholz at web.de> writes:

>> The problem is that quoted form is just a piece of data from
>> compiler's point of view, so it is kept as is and has to be interpeted
>> in runtime (while code generated by macros is usually compiled
>> normally);
>
> If that's the case, it's probably more due to lack of demand than due
> to serious technical issues.

IMHO it's not that simple - quoting is there to allow insertion of
literal data into program. It's not easy (and not always possible) to
deduce in compile time that some quoted expression will be used as a
code, especially if it is passed to other functions, stored in complex
data structures etc. before evaluation.

>> and [quoting will lead to] less intuitive code.
>
> Efficiency issues aside: how are macros more intuitive than quoting?

I meant quoting in Common Lisp - due to the absence of access to
lexicals data exchange between quoted and normal code is not
straightforward. If quoted and unquoted code were treated equally, it
wouldn't be a problem.

-- 
 							With regards, Roman.

Standard disclaimer: I work for them, but I don't speak for them.




More information about the Python-list mailing list