back2dos / tinkerbell

MIT License
83 stars 8 forks source link

how to have multi statement function for @:read? #26

Closed raould closed 12 years ago

raould commented 12 years ago

e.g. how could i add a trace statement in there?

@:read( trace(this); this.other*2 ) var bigger:Float;

back2dos commented 12 years ago

In Haxe, a block evaluates to the last evaluated subexpression, i.e. the following will do the trick:

  @:read( { trace(this); this.other*2; } ) var bigger:Float;