Is metaprogramming useful?

Steve Horne stephenwantshornenospam100 at aol.com
Wed Nov 29 15:14:33 PST 2006



OK - I think I get the source of this confusion, and surprise
surprise, it's my fault. So...


On Wed, 29 Nov 2006 16:28:29 -0500, Brad Anderson <brad at dsource.org>
wrote:

>> Based on that, you can write (1 + 2 * 3) if you want, but the result
>> will be 9, not 7.
>> 
>
>in a Lisp-like language, using prefix notation, this is:
>
>(+ 1 (* 2 3)) => 7

Yes, but if you say that Lisp is evil because you have to use prefix
notation, you get people jumping up to say 'no you don't - just define
your own syntax as a library'. That's basically where my point starts,
in a wider sense that starts outside this thread, which I obviously
didn't make clear. Hence the confusion - my key point is about syntax,
not semantics.

Getting back to what you said...

: I imagine that if some of the D power users
: wrapped themselves in Lisp for a while, they'd be able to do for themselves
: what they beg Walter to do for them in D.

In semantic terms that's true, but in syntax terms it's not - at least
not without going to the extreme compiler building stuff I mentioned
earlier. Lisp may provide the ability to set up whatever semantics you
want, but if you have to access that through a syntax that you just
can't get on with, that's a serious handicap. And the 'what they beg
Walter to do for them' is probably as much about syntax as semantics.

>This thing is a dead horse.  I suspect we are confusing each other, as you
>say.  You should look at Common Lisp a bit, esp. the link I posted to Peter
>Seibel's book.  Even a brief read may help you understand a bit of what I'm
>saying about metaprogramming.

I think I already know what you were saying to start with, and agree
with the Greenspun's 10th Rule bit. And your lack of coherence bit is
similar to a point I already made somewhere about the lack of standard
implementations of high level concepts in Scheme (or at least of ones
I can find).

It's the just-use-Lisp tone of what you said that I object to. Learn
from Lisp, yes, absolutely. Using it, though...

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



More information about the Digitalmars-d mailing list