suggested improvements to D

%u u at digitaldaemon.com
Mon Jan 8 22:53:16 PST 2007


== Quote from Warren D Smith (wds at math.temple.edu)'s article
> is there a nice way to handle these without gotos?

Using lazy evaluation seems D-ish here:

bool otherwise( lazy void dg)
{
    dg;
    return false;
}
void main()
{
  while( false || otherwise( printf("Falling through.\n")) ){
    // if( something) break
  }
  printf( "breaking out.\n");
}



More information about the Digitalmars-d mailing list