Passing function as values and returning functions

James Miller james at aatch.net
Thu Apr 12 07:49:03 PDT 2012


* Xan <xancorreu at gmail.com> [2012-04-11 20:28:38 +0200]:

> On Wednesday, 11 April 2012 at 13:04:01 UTC, Steven Schveighoffer
> wrote:
> >On Wed, 11 Apr 2012 08:53:00 -0400, Xan <xancorreu at gmail.com>
> >wrote:
> >
[snip]
> >writeln(g(&f)(1));
> >
> >Unlike C, you *must* take the address of a function symbol to get
> >a function pointer.
> >
> >-Steve
> 
> Yes, it works, finally.
> 
> Thanks, Steve.
> 
> Xan.
> 

Glad you got help Xan, but for future reference can you please keep
questions to D.learn? It is somewhat frustrating to see the question
"How do I do that?" on this list, since it is for discussion, and
high-level questions, not for people that are learning D.

(High level questions being along the lines of "What changes need to be
made in dmd to support the new AA implementation?")

--
James Miller


More information about the Digitalmars-d-learn mailing list