Will macros just be syntactic sugar? [EXAMPLE]

Jari-Matti Mäkelä jmjmak at utu.fi.invalid
Wed Apr 25 12:13:38 PDT 2007


Don Clugston wrote:
> Obviously, we want to get rid of the mixin() and the ``. But that's
> probably the only thing we need to do, outside of library code.
> Once we get rid of the ``, we have the requirement that all macro
> arguments must be syntactically valid D code. This makes things like
> your := impossible.

> But that will look pretty awful if you want to do more than a single
> function call. OTOH, if we just get rid of the ``, we lose the ability
> to make decisions at compile time.
> What then??

D being a multiparadigm language, it's a bit funny how many 'native'
possibilities there are to implement metaprogramming. All of them have
some good and some bad sides. So should these new constructs also cover
some meta object protocol or s-expressions or just this shorter syntax
for string mixins? Or should meta objects and s-expressions be
implemented on the library level?



More information about the Digitalmars-d mailing list