Safer casts
Yigal Chripun
yigal100 at gmail.com
Tue May 13 02:10:40 PDT 2008
Dee Girl wrote:
>
> But no language I know can pass the nested function by alias. Pass by
> alias is fundamental different from pass by delegate. I have tried to
> explain it all this time. Do we agree on this now?
the main thing for me is the syntax:
look at Nemerle, for example.
Here's a snippet:
class MoreFunctions {
static run_twice (f : int -> int, v : int) : int
{
f (f (v))
}
static run_adder (x : int) : void
{
def f (y : int) : int { x + y }; // <==== this is a nested function
System.Console.WriteLine ("{0}", run_twice (f, 1))
}
public static Run () : void
{
run_adder (1);
run_adder (2);
}
}
look at: http://nemerle.org/Grok_Functionals for a better explanation.
>
>> side note: I heard Walter doesn't like anything that looks or
>> smells like pascal.
>
> Then I am sure he wish Pascal did not have nested functions ^_^ PS I
> installed spell check for English on emacs now, at least fewer typos!
> Thank you, Dee Girl
>
More information about the Digitalmars-d
mailing list