gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] Re: Tla spork


From: Haakon Riiser
Subject: Re: [Gnu-arch-users] Re: Tla spork
Date: Fri, 27 Aug 2004 19:13:48 +0200
User-agent: Mutt/1.5.6i

Andrew,

>> Right, but then there's the power of macros...
>> 
>> Guess why it's so difficult to have powerful macro systems for
>> non-lisp languages.
> 
> Here's a good guess: it isn't. That's another myth.
> 
> I could add code to gcc's C parser to implement any macro system you
> care to specify. It would take no more than a few days.
> 
> I'm not going to waste a few days on something so useless just to
> prove a point. But I could.

How would you do that?  Unlike trivial macro processors such
as cpp, m4, etc., macros in Common Lisp work directly on the
parse tree.  This is natural in Common Lisp because the code
you're writing maps directly to the parsed form.  Other languages
have caught up with Lisp in every way, *except* for true macros,
which I (as of yet) have not seen anywhere else.

You could probably do something similar for C by having the macro
processor work on the parsed C code, but I imagine it would be
much harder to work with because the written code bears little
resemblance to the parse tree.

-- 
 Haakon




reply via email to

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