------art_4720_8961675.1214082179539
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

2008/6/21 James Britt <james.britt / gmail.com>:

> Marc Heiler wrote:
>
>> I don't know why exactly --only Matz knows-- but IMO the choice is
>>> somewhat arbitrary because whichever is chosen, class or module, you
>>> have to take away some of its typical behaviors to have it be
>>> singletonsomething.
>>>
>>
>> At times I wanted a language that does away with the distinction between
>> class and module and objects, and rather focuses on objects, and behaviour
>> only, with  an elegant syntax like ruby has (but less complex as a whole)
>>
>
> I wonder if Io fits the bill?


Possibly JavaScript fits the bill, as at its core it's simply composed of
Objects and Functions. (JavaScript 'classes' are really just constructor
functions.)

I was thinking about the distinction between classes and modules earlier and
I think it's an important one. Having single-inheritance classes makes sense
semantically, as class trees are supposed to mirror the problem you're
solving, and many things can be nicely modelled using a tree of categories.
Modules are really more about implementing cross-cutting concerns like
logging, observability or enumerability and it often does not make sense for
them to be part of the class tree or even to be instantiable. There is no
way you'd get me to make all my observable types inherit from an Observable
class -- it makes more sense to mix it in as a module.

In short, I think both do important (and distinct) jobs, and I'd much rather
have this than single inheritance without mixins (like Java -- see my
Observable argument) or all-out multiple inheritance, which doesn't make
sense semantically. Having a balance of both tools gives you a great deal of
power to get your design just right. Although you can *implement* class
inheritance as a special case of module inclusion, that isn't really how I
want to think when structuring my programs.

Still, you could give JS.Class a shot, then you've got classes, modules, and
JavaScript's own object system to play with...

James
http://jsclass.jcoglan.com

------art_4720_8961675.1214082179539--