From: Dale Martenson Date: 2004-05-27T02:57:56+09:00 Subject: Re: [RCR] Numeric#of > -----Original Message----- > From: Jeff Mitchell [mailto:quixoticsycophant@yahoo.com] > Sent: Tuesday, May 25, 2004 9:27 PM > > The "root cause" of this RCR (and others), I think, is the desire to > create an Enumerable out of an Integer. Integers themselves are not > Enumerable (nor should they be), but it is often desirable to think of > them as such. 100% agreement. It doesn't make sense having the proposed #of be part of Numeric. So no matter the solution, it should be added to Integer. > It is clear there is a desire to convert from Integers to Enumerables > freely. I think it is time to bring this into canon -- and I would > like to call it Integer#enum. > This is a best solution I have read so far. It avoids the confusion of 'of' and not only provide a facility to achieve the 'of' functionality, but also allow an Integer to take on all the characteristics of an Enumerable. This also appears syntactically 'clean'. The only possible change I would make would be in the name. Integer#to_enum This seems to follow and the other "to_xxx" named methods.