On Tuesday 08 September 2009 16:18:20 T.J. Crowder wrote:
@Jim,
Ie, Class.create takes any number of objects of functions or functions.
If functions, the function name is used.
I see where you're coming from, but FWIW I'm with Allen on this one.
Also, there's no standard way to get the
On Wednesday 09 September 2009 09:02:28 Jim Higson wrote:
I see where you're coming from, but FWIW I'm with Allen on this one.
Also, there's no standard way to get the name of a function until
ECMAScript5 (which standardizes the truly outrageous idea that
function instances should have
Hi all,
I thought of a wrinkle today: Mixins. This new mechanism modifies
function instances if they override base class functions (it leaves
them alone if they don't). So if you mix in something that has a
function with the same name as a parent class's function, we will set
a $super
TJ,
I don't particularly think this is a problem or even a new problem
(wouldn't the current let you do this as well?). This sounds like
protecting the developer from themselves. I think as long as you
sufficiently state what will happen in a particular instance then it
is perfectly reasonable
I'm with Allen on this. I don't think it's uncommon for mixins to want to
hook into existing functionality. This is trivial if they can invoke $super
(the original object's method), and problematic otherwise.
To give a concrete example, a while ago I implemented a Selectable mixin
for some
Hi Allen,
Thanks. I agree, it's a very edgy edge case. :-)
(wouldn't the current let you do this as well?)
Actually, it works in the current implementation, because if a mixin
function uses $super (which again is a bit odd), addMethods wraps it
up in a closure and never modifies the actual
On Sep 9, 7:29 am, T.J. Crowder t...@crowdersoftware.com wrote:
Hi all,
I thought of a wrinkle today: Mixins. This new mechanism modifies
function instances if they override base class functions (it leaves
them alone if they don't). So if you mix in something that has a
function with
Hi Robert,
That's a very interesting use case, thanks for that. I can certainly
see the utility of that, and in fact as I was writing all of this up
for my (pathetic little) blog I was getting increasingly uncomfortable
with the mixin issue.
If it's important for mixins to participate in