OpIn
downs
default_357-line at yahoo.de
Tue Feb 5 04:23:24 PST 2008
dominik wrote:
> I can't seem to find any docs about this, and I'm too thick to understand
> it.
>
> for example:
>
> use(context) in (GL gl) { draw(gl);}what the hell is this? How does it
> work? Why would one wan't it? etc...Explain it to me like I'm a retard,
> because I am. As far as I understand, "context" in this case is a delegate,
> which has gl as "in" and.. now what?thanks
>
>
use is presumably a function that returns a temporary struct.
The temporary struct defines opIn.
The (GL gl) { } is a delegate literal that takes a GL parameter.
So this code calls the temporary struct's opIn with a (void?) delegate(GL).
Hope it helps.
--downs
More information about the Digitalmars-d-learn
mailing list