PHP-style (embedded variables) print statements

Sean Kelly sean at f4.ca
Fri Jun 1 10:08:43 PDT 2007


Dejan Lekic wrote:
> I pray to God I will never have to write code like:
> 
>>      Stdout("current=")(i)(" next=")(i+1)(" const=")(k*3)(" ")(str);
> 

I think the Phobos syntax could probably be added to Tango using 
variadic templates:

     void opCall( Args... )( Args args )
     {
         foreach( arg; args )
             this.print( arg );
     }

Something like that.  But I personally don't find the "whisper" syntax 
to be particularly annoying.


Sean



More information about the Digitalmars-d mailing list