danieldasilvaferreira / gmail.com wrote:
> 
> I would say `:a.value == a.value # => true` But one has the
> symbol syntax as a property and the other not.

Syntax seems to have been mentioned a number of times during this
discussion, as though syntax were the distinguishing characteristic
between symbols and strings.

Symbols are conceptually distinct from strings, and the syntax used
to create either has no bearing on this fundamental distinction.

In Smalltalk, string literals are created with syntax 'foo' and
symbols are created with syntax #bar.  The syntax isn't what makes
them conceptually different entities.

[ https://www.gnu.org/software/smalltalk/manual/html_node/Two-flavors-of-equality.html ]

A statement suggesting :a and "a" are equal, apart from one having
"the symbol syntax", reads rather strangely to one accustomed to
thinking about the differences between strings and symbols as being
independent of their syntax.


Regards,

Bill




Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>