> > http://members.optusnet.com.au/~mathew/js/
> >
> > I hope this helps clear things up a bit.
> 
> That's support for classes in the same way C has support for classes
> though - you can design them on top of the language, but you don't get
> support for it for ordinary language elements or for built in
> operators.

I'm not sure what "ordinary language elements" means...  C cant do this (but 
the example page can):

some_type o = new some_type();
bool result = o.some_method();

where "some_method" is from a base-class.  C could do this:

some_type o = some_type_constructor();
bool result = some_method(o);

but then "some_method" would require the developer to somehow first cast down 
the inheritence chain, then fallback when nothing is found (all of which is 
automatically done for you in class-based OOP languages).

So, if the example page isn't OOP using class-based inheritence, I'm not sure 
what is....

Operator overloading is a feature of some languages - Java doesn't have it, so 
why is there an expectation that javascript should have it?  Also, I'm not sure 
what you mean by no support for built in operators, since "new blah(...)" is 
supported by javascript (aka 'new' is an operator).

> You're still not getting around that there's no built in support for
> classical inheritance, other than the pseudo-classes that are used in
> the ECMAScript spec internally but not for language for us users.

The internals of ECMAScript are irrelevant - it doesn't matter *how* I do it - 
and it doesn't matter if they are "psuedo classes" or not - it only matters 
that I can indeed create my own application specific class heirarchies.

And as it turns out, the syntax isn't too crap either, ie: we have effectively 
created the "Class" keyword:

  var NewType = Class("NewType",{ /* implementation */}, BaseType);
  var o = new NewType(...);

And we can even access the baseclass methods independently:

  o.some_method();
  o.SUPER.some_method();

What else do "us users" need?

Mathew Robertson


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to