On Thu, Apr 28, 2011 at 11:48 AM, amir e. <aef1370 / gmail.com> wrote:
> 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.

That wording does not really make sense.  You probably mean that every
operator is a method, do you?

> Now if every thing is object , then why =A0 + , - , * , ^ , ^^ =A0 isn't
> class Although they are primitive operation ?
>
> ps : If you test these codes , error happen : +.class =A0-.class =A0 *.cl=
ass

I am not 100% sure what you are up to but in case you wonder whether
"+" is not something tangible (i.e. an object) this might explain:
operators (+, - etc.) are mainly syntactic sugar for method calls and
you can actually invoke them like methods:

irb(main):001:0> 1 + 2
=3D> 3
irb(main):002:0> 1.+(2)
=3D> 3
irb(main):003:0> 1.send("+", 2)
=3D> 3
irb(main):004:0> 1.send(:+, 2)
=3D> 3
irb(main):005:0> 1.method "+"
=3D> #<Method: Fixnum#+>

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/