From: Rudolf Polzer Date: 2002-12-01T06:19:45+09:00 Subject: Re: Ruby ++, the one element and generators Scripsit ille aut illa MikkelFJ : [...] > In algebraic terms, there is no 'one' element for Real numbers, while > natural numbers (integers) do have a one element. Furthermore it is not > within the realms of Ruby to redefine the natural numbers, thus no next! > method. [...] You are referring to an algebraic 'group' (is it called like that in English?). A 'group' doesn't necessarily have a one element. But a N and Z_p do have a 'next' operation. Additionally, some other things might be a usable debugging help: properties of operators that can be defined: - commutativity: the parser randomly interprets a+b as a.+(b) and b.+(a) if in some debugging mode. - associativity: the parser randomly interprets a+b+c as (a+b)+c and a+(b+c) if in some debugging mode. - distributivity of *two* operators: the parser randomly expands (a+b)*c to a*c+b*c. I think *collecting* of terms shouldn't be done, since Ruby is an interpreter and not a computer algebra system. - existance of a neutral element: the parser randomly transforms x into 0+x or 1*x. - existance of some inverse element: there are mixins that define a-b and a/b as a+(-b) and a*b.inverse(). Maybe there could be similar things for the == and comparison operators. -- bash$ echo QUIT | nc news.t-online.de nntp 200 T-Online Newsserver bereit [06] (posting ok). 205 All your base are belong to us.