On Feb 11, 2008 2:35 PM, aljoscha <[EMAIL PROTECTED]> wrote:

>
> Not so in the newer Hash implementation of prototype (starting with
> 1.5 something) - by manually copying all methods to the "inheriting"
> classes this runtime flexibility was lost, probably as a trade off
> for gaining an improved memory footprint. Right?


Exactly. Whoever wants to extend Enumerable should do it through a custom
function that applies newly added methods to Array, Hash and other
prototypes.

I don't think we should spill tears over this. We've already pushed the
limits of JavaScript inheritance with the implementation of Class. We tried
to improve "modules", but for now they stay vanilla objects which methods
get copied over. I think that is good because if we make any more magic
trying to emulate features from other, more powerful OO languages, we could
only hurt ourselves. But if someone has a simple patch that doesn't hurt
performance, but adds a cool feature to Prototype classes/modules scheme,
we're always open to suggestions.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" 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/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to