[haXe] method equality
Ralf Bokelberg
ralf.bokelberg at gmail.com
Thu Aug 24 14:52:13 CEST 2006
Yes, makes sense.
Cheers,
Ralf.
On 8/24/06, Nicolas Cannasse <ncannasse at motion-twin.com> wrote:
> > Please disregard if this is old news.
> >
> > As far as i remember, we can't compare method variables in haxe,
> > because they are auto delegates. In Flex we have auto delegates also,
> > but because these delegates are stored in the trait object, they are
> > comparable again. Maybe we can try something similiar in haxe too? We
> > could copy all available methods into the instance. This should also
> > give some speed improvement.
>
> Method comparisons works fine *only* in Flash9, because the VM
> architecture automatically returns the closure for each method access.
>
> For other platforms, storing all the methods in the instance would kill
> both performances (when creating small objects containing a lot of
> methods, but also the cost of context-switching in all method calls) and
> memory (since the methods will need to be stored in each instance).
>
> You can safely compare methods in a crossplatform manner by preventing
> closures from being created. For that, you can either use a Dynamic
> intermediate variable to store your object or use the Reflect.field
> method to retreive the field.
>
> Nicolas
>
> --
> haXe - an open source web programming language
> http://haxe.org
>
--
Ralf Bokelberg <ralf.bokelberg at gmail.com>
Flex & Flash Consultant based in Cologne/Germany
More information about the Haxe
mailing list