What are the differences between these forms of function-like declarations ?

Anderel Cerol w_sholmes at hotmail.com
Wed Sep 5 21:32:29 PDT 2012


auto fun = (para)=>{...};
auto  fun = (para){...};
auto fun = delegate(para){...};
auto fun = function(para){...};
--------------------------------------------
void on(void delegate(int)callback){...}

on((para)=>{...});
on((para){...});
on(delegate(para){...});
on(function(para){...});
--------------------------------------------
some of them has the attribute @safe nothrow or @system,others
don't .
Is that inconsistency a intended design or not ?
The additional attributes  make some function parameter passing
not work since they have different signature .




More information about the Digitalmars-d mailing list