DMD 0.148 - regular expressions

Dave Dave_member at pathlink.com
Thu Mar 2 21:09:34 PST 2006


In article <dtr2ff$2vqr$3 at digitaldaemon.com>, Walter Bright says...
>
>if statement now can declare a variable for the result (an adaptation of Ben 
>Hinkle's idea). 
>

I haven't seen this brought up yet, so if it has my apologies.

The if(valptr; (key in AA)) syntax also nicely improves on how 'in' is used to
avoid double lookups IMO. Still uses a pointer, but it is alot better.

old way:

int* p = (key in AA);
if(p) (*p)++;
else AA[key] = 1;

new:

if(p; key in AA) (*p)++;
else AA[key] = 1;

- Dave





More information about the Digitalmars-d mailing list