Apple Blocks added to C++?

Nick Sabalausky a at a.a
Wed Sep 2 13:14:38 PDT 2009


"Nick Sabalausky" <a at a.a> wrote in message 
news:h7mjfe$2p0t$1 at digitalmars.com...
> "Walter Bright" <newshound1 at digitalmars.com> wrote in message 
> news:h7mch9$l5v$1 at 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...





More information about the Digitalmars-d mailing list