[haXe] initializing instance variables in declaration

Nicolas Cannasse ncannasse at motion-twin.com
Sun Apr 16 11:32:27 CEST 2006


> Hi,
> 
> I have a suggestion for reducing the typing required to initialize
> instance variables: make it legal to set their initial value at the
> point of declaration. So, instead of writing

IMHO, there's not so much need for this kind of sugar.
If your variable is a constant, you should as well use a static, that
you can already initialize this way. If it's not a constant, this is
good chances that it's parametrized by other variables or constructor
parameters, that you can't access outside the constructor body.

Nicolas



More information about the Haxe mailing list