Dynamic closure vs static closure

Jarrett Billingsley jarrett.billingsley at gmail.com
Sat Oct 25 08:38:55 PDT 2008


On Sat, Oct 25, 2008 at 9:30 AM, Yigal Chripun <yigal100 at gmail.com> wrote:
> anyway, I think you got my intention by now.
> I really don't want to have 3 kinds of function types. I think the
> already exsisting separation between function pointers and delegates
> could be handled better by adding an implicit cast.

It would start to become untenable, but I would imagine closures would
be implicitly convertible to scope delegates, since in effect they are
a subtype, and anywhere a scope delegate could be used, a closure
could be used as well.  Add to that implicit conversion from functions
to delegates using thunks and bam, you could have a function take one
type and it could accept all three.



More information about the Digitalmars-d mailing list