Why D _still_ needs the C preprocessor

Justin Scott jrs7561 at louisiana.edu
Sat May 5 20:55:11 PDT 2007


nobody at nowhere.nonet Wrote:

> Since D does not implicitly give the delegate the correct type,
> it takes a ton of keywords to make the delegate have the desired
> type. The result is this:
> 
> OMF_Record[] results = library.select_records(delegate(OMF_Record rec) { return (rec.record_type == LIB_HEADER);});
> 
> Hideous, no matter where you place the tabs and line breaks.

It's not as sugary sweet as you may want, but you can leave off the 'delegate' keyword.

OMF_Record[] results = library.select_records((OMF_Record rec) { return (rec.record_type == LIB_HEADER);});


More information about the Digitalmars-d-learn mailing list