From: Enric Lafont Date: 2002-11-04T06:50:35+09:00 Subject: Re: Thoughts on Ruby Austin Ziegler wrote: >On Mon, 4 Nov 2002 04:39:35 +0900, Albert Wagner wrote: > > >>On Saturday 02 November 2002 11:56 pm, Austin Ziegler wrote: >> >> >>>On Sun, 3 Nov 2002 10:57:29 +0900, Enric Lafont wrote: >>> >>> >>>>Why does common operators like "=" , "and", " .." , "or" etc ... >>>>can not be overloaded or redefined ?, maybe the complexity of >>>>the Ruby parser comes from the fact that everything is ALMOST an >>>>object or a method. >>>> >>>> >>>I don't actually see this (that everything is "almost" an >>>object). >>> >>> >>I read this differently. Certain peculiarities in the english >>syntax led me to suspect english-as-second language. I assumed, >>rightly or wrongly, that Enric meant that: ALMOST everything is an >>object or a method. >> >> > >I tried to read beyond the ESL. I still don't see that "almost >everything is an object or method". To me, everything in Ruby *is* >an object, and with the exception of boolean combinations and >keywords (and, or, etc.), everything else is a method -- even if it >doesn't have to be written that way. (I agree that from a SmallTalk >perspective that the fact that loops & such aren't messages does >appear weird.) > > Nope, Closures are not objects. And you need to Objectify closures when needed, something you don't need to do with integers or strings... >>>>Why is not "=" a method? >>>> >>>> >>Again, I think a misunderstanding. >> >> assignment comparator >>Smalltalk := = >>Ruby = == >> >> > >I'm not sure. '=' isn't a method, and it doesn't make sense to be a >method. '==' *is* a method and it's redefinable. > > I love Ruby, but this everything has an exception gets me nervous, my mind works better when there are not exceptions, just the general rule. = is an assignement and == is a comparission, the primitives are diferent but both can be methods (look at Smalltalk if you need some examples) Enric