Tango vs Phobos

Sean Kelly sean at invisibleduck.org
Mon Aug 11 13:16:32 PDT 2008


== Quote from Frank Benoit (keinfarbton at googlemail.com)'s article
> Sean Kelly schrieb:
> >
> >> 3.) the closures are not really closures. E.g. const variables can
> >> change value. (Bug 2043)
> >
> > This one, at least, is clearly a bug.
> >
> I think this is not a bug in the compiler. Instead it shows the bug in
> the concept.
> The concept is "simply allocate the whole stack frame on the heap". But
> it turns out to be not sufficient. Now what? Heap allocated each scope
> also? for every loop iteration?

Yup.  It's essentially the same as heap allocating for the scope created by
a function call.  I imagine the hope is that compiler introspection would
be able to figure out when such allocations are necessary and when only
one would suffice.  Barring that, the programmer would need some way
of indicating this to the compiler, which is something we need anyway
as always heap allocating in a systems language renders delegates
unusable for certain classes of application.


Sean



More information about the Digitalmars-d mailing list