Extended Type Design.

Reiner Pope reiner at none.com
Sat Mar 17 00:03:01 PDT 2007


Andrei Alexandrescu (See Website For Email) wrote:
> Combined with macros, this will essentially allow a call to writefln to 
> morph, depending on its arguments, into putch(), fputs(), write(), 
> fprintf() - or execute today's dynamically-checked writefln.
So is there going to be a way to specify at the function (or template) 
definition site that the function (or template) produces a compile-time 
string which is to be mixed into the call site. eg:

// The 'mixin' specifies that the result should be mixed into the call site.
mixin char[] writefln(/*params*/)
{
     ... // Generate code
     return generatedCode;
}


Sounds good.


Reiner



More information about the Digitalmars-d mailing list