Is metaprogramming useful?

Steve Horne stephenwantshornenospam100 at aol.com
Wed Nov 29 12:45:52 PST 2006


On Wed, 29 Nov 2006 14:11:01 -0500, Brad Anderson <brad at dsource.org>
wrote:

>Steve Horne wrote:

>> There are things you just can't do with Scheme macros. Associativity
>> and precedence, for instance. This means that if you want to do these
>> things, you have to go the Von Neumann route - treat code as data and
>> manipulate it at compile time using Scheme functions.
>
>I'm not following.  Do you have definitions or examples of these?

No, but it's implicit in the subset of the Scheme language that I
understand.

The term to look up is 'quoting'. A quoted expression may look like
code, but to Scheme it is just a list of tokens. You pass that list as
a parameter to a function that can make sense of it, and you have a
new language extension. And the translation should happen at compile
time, though at this point we are running into the limits of my
knowledge of Scheme.

>http://lambda-the-ultimate.org/node/1605

I can't seem to access that ATM, but I'll give it another go later.

Going purely on the URL, though, lambdas (first class functions)
aren't really the issue here. It's a powerful tool - one thats widely
imitated these days - but it isn't a metaprogramming thing.

-- 
Remove 'wants' and 'nospam' from e-mail.



More information about the Digitalmars-d mailing list