"Nick Sabalausky" <a...@a.a> wrote in message news:h7mjfe$2p0...@digitalmars.com... > "Walter Bright" <newshou...@digitalmars.com> wrote in message > news:h7mch9$l5...@digitalmars.com... > > BTW, if you think the "nested funcs" most languages have are bad, you > should see the Haxe version: > > class EverythingMustBeInAClass_Natch > { > var member:Int; > void bar():Void > { > var local:Int; > > // Ok so far... > local = 1; > member = 1; > > // Holy crap, what happened? > // (Although, to be fair, the ":Type" parts could > // probably be omitted...but still...) > var _this:EverythingMustBeInAClass_Natch = this; > var nestedFunc:Int->String->Bool = > function(a:Int, b:String):Bool > { > local = 1; > _this.member = 1; > } > } > } >
Erm...I forgot to return a value in the "nested func", and then call the "nested func", but you get the idea...