| |
| Posted by Carlos Santander B. in reply to Andy Friesen | PermalinkReply |
|
Carlos Santander B.
Posted in reply to Andy Friesen
| "Andy Friesen" <andy@ikagames.com> escribió en el mensaje
news:b1h5uk$2omp$1@digitaldaemon.com...
| Basically, some syntactic sugar for small functions that are only needed
| for a moment.
|
| alias void delegate(int i) Function;
| Function f = Function { return i * 3 };
|
| Or somesuch. If one wants to get fancy, one could get the compiler to
| try and inline them when passed as template arguments, which opens the
| doorway to C++ STL-like algorithms.
|
| instance Algorithm(SomeType,
| Comparer {
| return a.something > b.something;
| }
| ).Sort(somearray);
|
| Maybe the syntax isn't so hot, though.
|
What about functions inside other functions (what's the real name for that), like in Delphi? I'm not sure about the syntax, but maybe that could be a workaround (sp?) for anon functions. Or am I getting it wrong?
-------------------------
Carlos Santander
http://carlos3.netfirms.com/
"Andy Friesen" <andy@ikagames.com> escribió en el mensaje
news:b1h5uk$2omp$1@digitaldaemon.com...
| Basically, some syntactic sugar for small functions that are only needed
| for a moment.
|
| alias void delegate(int i) Function;
| Function f = Function { return i * 3 };
|
| Or somesuch. If one wants to get fancy, one could get the compiler to
| try and inline them when passed as template arguments, which opens the
| doorway to C++ STL-like algorithms.
|
| instance Algorithm(SomeType,
| Comparer {
| return a.something > b.something;
| }
| ).Sort(somearray);
|
| Maybe the syntax isn't so hot, though.
|
What about functions inside other functions (what's the real name for that), like in Delphi? I'm not sure about the syntax, but maybe that could be a workaround (sp?) for anon functions. Or am I getting it wrong?
-------------------------
Carlos Santander
http://carlos3.netfirms.com/
|