Having a Client is Wonderful

I have been developing Yap in somewhat of a vacuum for the 14 months. I would occasionally post something on here and/or show some newly functioning code to friends or coworkers with pride, but I can’t stress enough what a difference having a real “client” of your code makes.

I granted early access to Yap to my friend and former coworker Shannon, and his random questions/criticisms alone have really motivated me to add in features I have been delaying for no great reason. In just the last few days:

* Fixed a really dumb crash he found that I hopefully would have caught
* Started reorganizing all of my global functions into something that makes more sense
* Completely reworked my OO “system” and function notation to be more friendly
* resurrected the ‘this’ keyword in a much simpler way
* eliminated the somewhat hacky ‘with’ scope
* Added closure support!

Anyway, I’d like to offer a big Thank You to Shannon for being the first client of Yap; having a client is wonderful.

As for closure support, this code will associate a new integer variable alongside each function reference that is returned from makeClosure(), and is incremented and returned each time f() is called. Woo!

function makeClosure()
{
    var a = 13;
    return function()
    {
        a += 1;
        return a;
    };
}

var f = makeClosure();
Posted in Blog