On Tue, Jun 17, 2008 at 5:07 PM, machineghost <[EMAIL PROTECTED]> wrote:
> 1. Chainability: with this syntax you can chain functions do stuff
> like:
>    someObject.update(updateObject1).update(updateObject2);

True, that _is_ something that can't be done with function-oriented
syntax. Personally, I'm not that found of this "fluent interfaces"
style; I think it works fine for simple cases, but lose it's punch
when things get more complex. Plus it can get a bit unintuitive, when
taken out of context. But I understand, that some people like it.

The way jQuery's api works, should make it possible to provide some of
these things without messing with built-in prototypes, I reckon? You
could simply return wrapper objects, which have the methods available?
I don't even remember if jQuery does this?

On Tue, Jun 17, 2008 at 5:07 PM, machineghost <[EMAIL PROTECTED]> wrote:
>
> Actually, come to think of it 5.counter() wouldn't even work (since 5
> is scalar, it doesn't inherit object.prototype methods).  But
> hopefully you get the idea.

It works. 5 is a scalar, but it's automagically wrapped in an object,
when used as such.

--
troels

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
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