From: Henning von Rosen Date: 2001-09-24T22:49:23+09:00 Subject: [ruby-talk:21636] Re: subclassing of 'Class'| numbers as classes > >>>>> "H" == Henning von Rosen writes: > > H> Why can't the class "Class" be subclassed? > > See the thread "Deriving from Class" in ruby-talk, especially > [ruby-talk:17927] > > http://www.ruby-talk.com/17927 > Oh, I see. Well, I'm just trying to trans-implement numbers to be classes, not single instances.(as in Fixnum, or just-in-time-instances as in Bignum). Just to be consistent with human cognition/natural language. Anyone imagine easy way to implement this? Just for it to work, performance is not an issue at the moment. Hmmm I suppose I would have to manipulate the Ruby parser... Hints are very welcome! Ask me for details if description not clear! /H --- #example of usage: That would for example mean that you coluld implement the must-be-in tutorial algorithm example of the factorial like this: (in pseudo-Ruby) def PositiveInteger.fact(x); x*(x-1).fact; end def 1.fact;1;end (of course it would have to be dynamically implemented, since the number of numbers is unlimited, something similar to