feature request: with(var decl) {}

Chris NS ibisbasenji at gmail.com
Tue Jul 24 00:03:04 PDT 2012


I can't help thinking it sounds rather like a job for... named 
parameters.  Just imagine it:

##############################
void foo ( bool closeButton = true, int width = 600 ) {
     writeln( closeButton, ", ", width );
}

void main () {
     foo( closeButton: false );
}
##############################

With output:
false, 600

Gosh, that'd sure be swell.  (Either that or find a way to sanely 
allow non-static struct initializers, at least for rvalue 
arguments.)

-- Chris NS


More information about the Digitalmars-d mailing list