News for hackers. Stuff that matters.
Re:How Javascript Prototypal Inheritance Really works by pom on Saturday May 28, 2011 @11:48AM (#2594608)
It took me a while to get it, especially since the new keyword makes matters really confusing. But after reading about the language Self, I am really using prototypal inheritance, and no more of the "new" business for me.
Re:How Javascript Prototypal Inheritance Really works by munificent on Saturday May 28, 2011 @05:16PM (#2595234)
Got any public code? I'd like to see examples of non-class-style JS code.
Re:How Javascript Prototypal Inheritance Really works by pom on Saturday May 28, 2011 @09:07PM (#2595593)
You can have a look at: https://github.com/julienq/spqr/blob/master/populus.js

Bear in mind that it's still a work in progress. Look for "populus.object", especially create(), is_a() and call_super(). There is still something called $new (not new because some picky parsers don't like it) but it's just the chaining of create() (a wrapper around Object.create()) and init().

Re:How Javascript Prototypal Inheritance Really works by jashkenas on Saturday May 28, 2011 @09:13PM (#2595604)
Re:How Javascript Prototypal Inheritance Really works by pom on Saturday May 28, 2011 @11:20PM (#2595883)
If you have more detailed feedback (positive or negative) I'd be happy to hear it. I'm still figuring this out at the moment.