From: Robert Dober Date: 2007-07-19T06:09:43+09:00 Subject: Re: syntactic sugar buzz On 7/18/07, Chad Perrin wrote: > On Wed, Jul 18, 2007 at 09:17:45PM +0900, dblack@wobblini.net wrote: > > > > My favorite slogan for Ruby is: > > > > The triumph of balance over symmetry. > > > > It means, for example, that it might make sense for nil to have #to_s > > -- and that it still might *not* make sense for nil to have #split. > > One does not imply the other. Every decision is made carefully, one > > at a time, in the interest of the usefulness of the system overall. > > That makes perfect sense, since the logical way to use split would be > with something like nil.to_s.split. If you really want split to return > something "useful" from nil directly, I'd say add your own split to > NilClass and be done with it. It makes perfect sense, but it is an example ex nihilis as I was complaining about nil.to_i and Integer(nil), or am I in the wrong thread (has happened to me before :()? > > > > > > That's why I don't care about symmetry or consistency (which I think > > in this case mean much the same thing). We're lucky enough to have > > Matz hand-crafting the language with the greatest care; I think that's > > a higher-percentage prospect than a principle of uniformity :-) > > I care about consistency -- in a way that makes sense, of course. I > don't see how nil lacking a split() violates that. Nor do I, nor did I say so, I just wanted to say, hey if nil has to_i, it can have split too, that would be no big deal at all. Cheers Robert -- I always knew that one day Smalltalk would replace Java. I just didn't know it would be called Ruby -- Kent Beck