I never used `bindMethods`. I can see why a Pythonista might find it
intuitive, but quite frankly, it's reveals a fundamental
misunderstanding of the language being used. Javascript does not have
classes, and trying to emulate them is going to be a very leaky
abstraction. You would be much better off using the features that the
language supports (prototypical inheritance). Maybe the documentation
should include a note about this, under `bindMethods`?

--
troels

On Mon, Oct 6, 2008 at 5:40 PM, Akari no ryu <[EMAIL PROTECTED]> wrote:
>
> Ok, I've searched through the archives for posts referencing the word
> "inheritance" but most of them are just referring to prototype and the
> lack of scope that JS gives you if you don't bindMethods(this)
> I'm asking about actual OO inheritance in this post, wherein a class
> inherits methods from another class.
>
> I've also tried google but that was utterly useless. Gave me
> suggestions for code which doesn't work when you're using MochiKit,
> because of the bindMethods function.
>
> I've added a bequeathTo method to my helper class which does the
> following
>
> Helper.prototype.bequeathTo = function(other)
> {
>   for(var i in this)
>   {
>     other[i] = MochiKit.base.bind(this[i], other)
>   }
> }
>
> That works.
> It's been tested and implemented in two classes that inheret methods
> from it.
> I'll upload my code for linkage later.
>
> I don't know if all y'all want to implement this but I though I'd post
> just in case.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to