Forum: Ruby What's up with symbols?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Hans-Eric Grönlund (Guest)
on 2006-04-03 17:05
Hello fellows!

I'm trying to understand symbols. Not what they are, but rather why Ruby
has them. They are neat and I use them, but effectively you end up with
the same thing using plain strings, right? So why extend the language? I
get the feeling I'm missing a big point so please help me out by
pointing it out to me.

Best regards

Hans-Eric Grönlund
Daniel H. (Guest)
on 2006-04-03 18:20
(Received via mailing list)
On Apr 3, 2006, at 3:06 PM, Hans-Eric Grönlund wrote:

> I'm trying to understand symbols. Not what they are, but rather why
> Ruby
> has them. They are neat and I use them, but effectively you end up
> with
> the same thing using plain strings, right? So why extend the
> language? I
> get the feeling I'm missing a big point so please help me out by
> pointing it out to me.

Hi,

See:

* [Symbols Are Not Immutable Strings][1]
* [Many previous discussions on the list][2]

[1]: http://onestepback.org/index.cgi/+Tech/Ruby/
SymbolsAreNotImmutableStrings.red
[2]: http://groups.google.com/group/comp.lang.ruby/search?
group=comp.lang.ruby&q=symbols&qt_g=1&searchnow=Search+this+group

-- Daniel
James B. (Guest)
on 2006-04-03 18:23
(Received via mailing list)
Hans-Eric Grönlund wrote:
> Hello fellows!
>
> I'm trying to understand symbols. Not what they are, but rather why Ruby
> has them. They are neat and I use them, but effectively you end up with
> the same thing using plain strings, right?

No.  There was a lengthy thread about Symbols here on ruby-talk not too
long ago, so perhaps you'll want to search the archives.


> So why extend the language? I
> get the feeling I'm missing a big point so please help me out by
> pointing it out to me.

See also

http://www.oreillynet.com/ruby/blog/2005/12/symbol...
http://www.oreillynet.com/ruby/blog/2005/12/diggin...



--
James B.

"A language that doesn't affect the way you think about programming is
not worth knowing."
   - A. Perlis
Tom A. (Guest)
on 2006-05-23 06:20
(Received via mailing list)
Daniel H. wrote:
>
> -- Daniel
Is there somewhere besides the newsgroup for this?
This topic is locked and can not be replied to.