Forum: Ruby Different between symbol and string ?

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.
61e779356107a8e9cabf1a71e8196914?d=identicon&s=25 Chris Li (evil850209)
on 2008-12-02 03:00
What is exactly different between symbol and string ? Symbol has never
appear in other language.
A61ecce13ed142622f24a5ca3a123922?d=identicon&s=25 Matthew Moss (Guest)
on 2008-12-02 03:16
(Received via mailing list)
On Dec 1, 2008, at 7:54 PM, Chris Li wrote:

> What is exactly different between symbol and string ? Symbol has never
> appear in other language.

In a sense, symbols appear in almost every language, but under another
name: identifier. A Symbol is an identifier without any associated
storage.

Granted, that's probably too simple/naive an explanation. You might
also try searching the archives for this mailing list; discussions
about Symbol have come 'round many a times with some quite thorough
discussions.
0f219c7f9881727773afcb1634d6cb24?d=identicon&s=25 _-_ Daniel _-_ (Guest)
on 2008-12-02 03:50
(Received via mailing list)
On Mon, 01 Dec 2008 17:54:58 -0800, Chris Li <libo5426@gmail.com> wrote:

> What is exactly different between symbol and string ? Symbol has never
> appear in other language.


http://glu.ttono.us/articles/2005/08/19/understand...
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2008-12-02 03:55
(Received via mailing list)
Chris Li wrote:

> What is exactly different between symbol and string ? Symbol has never
> appear in other language.

Except for the Smalltalk #symbol and the Perl "bareword" concept...

Irritatingly, _all_ languages have an internal "symbol table" concept,
but they
keep it hidden. Only the best languages expose it as a programmer
convenience...
4dea430d31b993abaf41cd9b54f8128d?d=identicon&s=25 Avdi Grimm (avdi)
on 2008-12-02 05:11
(Received via mailing list)
On Mon, Dec 1, 2008 at 9:49 PM, Phlip <phlip2005@gmail.com> wrote:
> Chris Li wrote:
>
>> What is exactly different between symbol and string ? Symbol has never
>> appear in other language.
>
> Except for the Smalltalk #symbol and the Perl "bareword" concept...

...and Lisp symbols...

--
Avdi

Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com
This topic is locked and can not be replied to.