[Rails] Re: Assignment with ?

2009-08-13 Thread Robert Walker
Marnen Laibow-Koser wrote: Frederick Cheung wrote: On Aug 12, 4:37�pm, Marnen Laibow-Koser rails-mailing-l...@andreas- s.net wrote: are methods in Ruby. �Not all methods are operators, but that's another syntactic issue. If we're being pedantic, then not all operators are methods: ! is

[Rails] Re: Assignment with ?

2009-08-13 Thread Marnen Laibow-Koser
Robert Walker wrote: [...] Is there really a valid distinction between operators and methods anymore? Not for all operators in Ruby. In some languages, not for *any* operator Isn't the syntax essentially syntactic sugar allowing for simplified use of some of the methods? Yup. And if

[Rails] Re: Assignment with ?

2009-08-13 Thread s.ross
On Aug 13, 2009, at 2:36 PM, Marnen Laibow-Koser wrote: Robert Walker wrote: [...] Is there really a valid distinction between operators and methods anymore? Not for all operators in Ruby. In some languages, not for *any* operator Isn't the syntax essentially syntactic sugar allowing

[Rails] Re: Assignment with ?

2009-08-12 Thread Robert Walker
Sijo Kg wrote: Hi brianp The operator has many different uses: A googling gave Just a small clarification: is not an operator, it is a method. It has whatever meaning that is defined by its class. -- Posted via http://www.ruby-forum.com/.

[Rails] Re: Assignment with ?

2009-08-12 Thread Conrad Taylor
On Wed, Aug 12, 2009 at 6:19 AM, Robert Walker rails-mailing-l...@andreas-s.net wrote: Sijo Kg wrote: Hi brianp The operator has many different uses: A googling gave Just a small clarification: is not an operator, it is a method. It has whatever meaning that is defined by its

[Rails] Re: Assignment with ?

2009-08-12 Thread Marnen Laibow-Koser
Robert Walker wrote: Sijo Kg wrote: Hi brianp The operator has many different uses: A googling gave Just a small clarification: is not an operator, it is a method. It has whatever meaning that is defined by its class. is most certainly an operator. It is also a method; all

[Rails] Re: Assignment with ?

2009-08-12 Thread Marnen Laibow-Koser
Frederick Cheung wrote: On Aug 12, 4:37�pm, Marnen Laibow-Koser rails-mailing-l...@andreas- s.net wrote: are methods in Ruby. �Not all methods are operators, but that's another syntactic issue. If we're being pedantic, then not all operators are methods: ! is not a method, nor is ?: and

[Rails] Re: Assignment with ?

2009-08-12 Thread brianp
Thanks for the clarification everyone! I wouldn't have expected it to have different meaning depending on he object/class type. I'll keep an eye out for that. On Aug 12, 9:40 am, Marnen Laibow-Koser rails-mailing-l...@andreas- s.net wrote: Frederick Cheung wrote: On Aug 12, 4:37 pm, Marnen

[Rails] Re: Assignment with ?

2009-08-12 Thread Conrad Taylor
On Wed, Aug 12, 2009 at 10:49 AM, brianp brian.o.pea...@gmail.com wrote: Thanks for the clarification everyone! I wouldn't have expected it to have different meaning depending on he object/class type. I'll keep an eye out for that. On Aug 12, 9:40 am, Marnen Laibow-Koser

[Rails] Re: Assignment with ?

2009-08-11 Thread Conrad Taylor
On Tue, Aug 11, 2009 at 2:23 PM, brianp brian.o.pea...@gmail.com wrote: Hey, I'm just going through Agile Web Development With Rails and we're using what I'm assuming is an assignment operator. ex: @items current_item In the above context, means to append 'current_item' to the end of

[Rails] Re: Assignment with ?

2009-08-11 Thread bill walton
On Tue, 2009-08-11 at 14:23 -0700, brianp wrote: Hey, I'm just going through Agile Web Development With Rails and we're using what I'm assuming is an assignment operator. ex: @items current_item But (unless i skipped it) they didn't really explain what that was. So what is it

[Rails] Re: Assignment with ? **solved**

2009-08-11 Thread brianp
On Aug 11, 2:38 pm, Conrad Taylor conra...@gmail.com wrote: Also, I would recommend getting a copy of the 'Programming Ruby' and/or 'Programming Ruby 1.9'. -Conrad thanks for the help/recommendation. In the passed 2 week I went through Simply Rails 2, now AWDWR, next up is Why's (Poignant)

[Rails] Re: Assignment with ? **solved**

2009-08-11 Thread sami
is not only for collection class . even it also works for string suppose veriable1 = abc veriable1 def then if you print the value of veriable1 you will get abcdef On Aug 12, 5:21 am, brianp brian.o.pea...@gmail.com wrote: On Aug 11, 2:38 pm, Conrad Taylor conra...@gmail.com wrote:

[Rails] Re: Assignment with ?

2009-08-11 Thread Sijo Kg
Hi brianp The operator has many different uses: A googling gave In an Array it is used to append (push) an object into a given array In a Fixnum and a Bignum object it shifts the number bits to the left In an IO object it will write the object (as a string) to the IO object. In a