[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Variables starting with ":"

Gavin Kistner

1/9/2007 9:28:00 PM

From: Eduardo Scoz
> What's the diference between regular variables defined as, lets say
> "example", and the ones defined as ":example" ? If there's a
difference,
> when should each case be used?

Items that start with a colon are not variables, they are Symbols.
Continue your research with that bit of information; there's a lot out
there on the difference between Symbols and Strings (in 1.8), and when
to use them.


2 Answers

Eduardo Scoz

1/9/2007 9:51:00 PM

0

Gavin Kistner wrote:
> From: Eduardo Scoz
>> What's the diference between regular variables defined as, lets say
>> "example", and the ones defined as ":example" ? If there's a
> difference,
>> when should each case be used?
>
> Items that start with a colon are not variables, they are Symbols.
> Continue your research with that bit of information; there's a lot out
> there on the difference between Symbols and Strings (in 1.8), and when
> to use them.

Thanks a lot, Gavin. Now I know what to look for.. I've never read about
Symbols before on any of the books I've read so far.


Thanks!!

--
Posted via http://www.ruby-....

Eduardo Scoz

1/10/2007 5:57:00 PM

0

>
> Be sure to check out this ridiculously long post on the subject. I'm
> still
> digesting it (seriously, it was crunchy at times, and it sits kind of
> heavy
> in the belly but it's worth it. )
> http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-t...

Fantastic! Thanks a lot for the link!! It was a really useful read!! :)

Which other links like this do you have there to share?? :)

Thanks again, Jason!

--
Posted via http://www.ruby-....