Notes on D future

Deewiant deewiant.doesnotlike.spam at gmail.com
Wed Aug 29 02:32:44 PDT 2007


Reiner Pope wrote:
> Consider the more useful example of a modified writefln. You might have two 
> prototypes:
>
> writefln(...); // runtime varargs
> writefln(static string s, ParamTypes!(s)); // compile-time varargs, with
> types checked at compile-time by parsing the formatting string
>
>
> This still *could* be done automagically by the compiler, but less likely so.
> I agree that it would be nice if the compiler did this as an optimization,
> though.

Good example, made me realize that it's more than just syntactic sugar for
template parameters.

Well, actually it's not, but the sugar is at the call site as well, which
means you don't have to know about it to use it. That's the key point, IMO.

-- 
Remove ".doesnotlike.spam" from the mail address.



More information about the Digitalmars-d mailing list