From: Stu Date: 2011-04-29T04:43:58+09:00 Subject: Re: Is everything object ? Everything is a sender and receiver in ruby. The operators you list are methods tied to the classes they work on. This is known as polymorphism. ex: 4 + 6 is 4.+( 6) see Object dot method with argument (can be read 4.add(6) ) Ruby has a way where the interpreter will work without the dot and parenthesis Where the polymorphic design of the language comes in is the redefinition of + for other class types such as strings and collections. for a string it will concatenate: "Hello, " + " world!" is string.concat(string) observe this in irb as well: "Hello, ".+("world") String.new("Hello, ").+("world") These are all equivalent. last example: [42,17,3.14] + [999] is Array.new( [42,17,3.14]).+( [999]) So essentially the primitive operations as you word it are really complex and cleverly designed methods provided to give the illusion of they are primitive. They are methods in ruby. redefined in each respective class to provide the proper abstraction on the type of data the operands are dealing with. If this may give you a better perspective on your question let's break the interpreter. Type this in irb: class Fixnum def +(arg) 42 end end now running any addition will result with the number 42. Of course you don't want to mess with the numerical classes but when you go on to write your own classes it may come in handy to redefine these operand methods within those classes to aid in the classes abstraction. ~ On Thu, Apr 28, 2011 at 4:48 AM, amir e. wrote: > Hi > A very important principle in Ruby is that every thing is object. > I read somewhere that there is no primitive operation in Ruby in > traditional form and every operation is class. > Now if every thing is object , then why   + , - , * , ^ , ^^   isn't > class Although they are primitive operation ? > > ps : If you test these codes , error happen : +.class  -.class   *.class > > -- > Posted via http://www.ruby-forum.com/. > >