From: sto.mar@... Date: 2013-07-24T15:10:11+09:00 Subject: Re: class <=> module Am 24.07.2013 01:04, schrieb Br叩ulio Bhavamitra: > Hello all, > > Recently I got the error described at > https://www.ruby-forum.com/topic/1506818, > which shows that classes can't be used to scope another classes or > modules. > > Then I started thinking: why two concepts, class and module, instead of > only one? > > Classes heritage, a feature modules don't have, can be done with include > and extend togheter. So we would need another method that does both > include and extend (call it inherit). Classes can't be used to define a > scope. > Modules can't be instanciated, but classes can. > > So why not have only one concept that does both class and modules? You > may call this unified concept either class or a module, I'll call it X. > > X is capable of extending, including and inheriting, does scoping and be > instanciated. > > How does it sound? That sounds like: We have two different things that behave differently and serve different purposes. Why don't we replace them by one thing. Not very convincing to me... :) And you forgot to mention: classes can inherit only from a single other class (a conscious decision by Matz), but you can include many modules. Seems difficult to unify that in one concept. Regards, Marcus --