Hi all,
I realise this has been done before, indeed my new library is based on
the Prototype model and Alex Arnell''s Inheritance model, but neither
of them quite behave exactly how I''d like. My major concern is that
writing classes using Prototype''s $super is not compatible with code
compressors, because of the need for argument name inspection. I''ve
released JS.Class, which is hopefully a much more Ruby-ish
implementation of classical inheritance. Its basic features are...
* Simple, elegant single-inheritance model
* Clean, intuitive access to the class hierarchy from within
instance methods, as well as through class interfaces
* Automated inheritance: adding class/instance methods to a class
after its initial definition instantly updates all its subclasses and
their instances
* Mixins, like in Ruby (this is essentially Ruby-ish syntax
masking a trivial JavaScript feature)
* super, with arguments optional
* is_a support (JavaScript trivially supports has-a relationships
itself)
I''d be chuffed if anyone feels like checking it out and letting me
know the results. It can be used without Prototype -- it uses
Function#bind and Array.from, which it defines itself. And it''s just
1.0 kb when gzipped, and will support code that''s been compressed.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---