Higher-order functions?

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Apr 11 10:35:55 PDT 2012


On Wed, Apr 11, 2012 at 07:29:20PM +0200, Jonas H. wrote:
> Wow, thanks for all the answers! Seems to be a great community here.

Welcome to the community! :-)


> What do you guys think about adding the term "anonymous functions"
> to the frontpage and features page? I think that one's a lot more
> comman than "delegates" (even if it's not exactly the same thing).

Keep in mind that there are two kinds of function here, one is
"function" which is just like a C function pointer (cannot access
variables in its containing lexical scope), the other is "delegate",
which is a "fat" function pointer (has access to variables in containing
scope).

Furthermore, there's a distinction between the function
pointers/delegates themselves vs. function literals (i.e., the syntax of
writing (int x) => (x^^2)), which is probably what you mean by
"anonymous functions" here.


T

-- 
One disk to rule them all, One disk to find them. One disk to bring them
all and in the darkness grind them. In the Land of Redmond where the
shadows lie. -- The Silicon Valley Tarot


More information about the Digitalmars-d-learn mailing list