Extended Type Design.
    Walter Bright 
    newshound at digitalmars.com
       
    Sat Mar 17 01:49:59 PDT 2007
    
    
  
eao197 wrote:
> On Sat, 17 Mar 2007 01:41:54 +0300, Walter Bright 
> <newshound at digitalmars.com> wrote:
> 
>> eao197 wrote:
>>> No, at first there must be 'D with macros' (like 'C with classes') 
>>> and only then -- D++ :))
>>
>> D will get macros - but they won't be text processing macros, they'll 
>> be abstract syntax tree (AST) processing macros.
> 
> It is very interesting to hear that. Could you say more about the future 
> macro system in D? Or it is a secret now?
It's pretty simple:
	macro foo(args)
	{
		...syntax that gets inserted...
	}
and the args and syntax is evaluated in the context of the invocation of 
the macro, not the definition of the macro. You'll be able to do things 
like:
	macro print(arg)
	{
		writefln(__FILE__, __LINE__, arg);
	}
which get the file and line in the right context. There's no way to do 
that right now.
    
    
More information about the Digitalmars-d
mailing list