Forum: Ruby OT: What is in a name? (was: Demystifying 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.
E7559e558ececa67c40f452483b9ac8c?d=identicon&s=25 unknown (Guest)
on 2006-01-05 23:48
(Received via mailing list)
On Jan 5, 2006, at 3:54 PM, Steve Litt wrote:
>> self-modifying Object, and not an ordinary string at all.
>
> I don't think it would hurt to think of it as an immutable string
> (not a
> String), in your own personal life. However, that probably would
> not go over
> well on a mailing list :-)

This is pretty far off topic but might be of some interest to some of
you
(or none of you).

I don't think of my personal name as the immutable string composed of
the roman letters G a r y.  My name is Gary and it has the properties of
a name not the properties of a sequence of Roman letters.  In fact
there are
a variety of character sequences that can be interpreted as my name:

	G a r y
	G A r y
	g A R Y
	g a r y

and if you want to switch to a different font or UTF-8 or whatever, then
the list is endless.  You can also convert my name to sound waves and it
works as a name also. There are other people who share my name.  Most of
them I've never met and never will meet but we have this abstract thing,
a name, in common.  Someone, somewhere probably has a dog named Gary.
But that doesn't mean he is named after me or I'm named after him.  We
just share the name.  Maybe some Ruby programmer has created
a class named Gary without asking me if it was OK, or maybe it was a
Java programmer.

In fact, names don't even have to be associated with anything in
particular
they can exist independent of any referent. For example, I don't think
anything has ever been given the name AdafkeqkndkXXXgkos, but
that particular name just got created at the moment I referenced it
and it
happens to have an analogous string of Roman letters. Maybe it is
pronounceable (probably in Klingon).  If you looked at
the binary values of those letters encoded in ASCII and considered them
as just one big binary value then you could say there is a particular
integer value that is analogous to that name also.  The integer
1197568633 is analogous to my name as is 47617279 and 13m2sjp or
alternatively
1197568633, 47617279, and 13m2sjp are all names for one particular
mathematical integer.  You could say that integer has the name Gary.

I think in a very deep, conceptual way, Ruby symbols behave like names
just as Ruby fixnums behave like integers.

But maybe I'm just weird.

:Gary :Wright
82e62c756d89bc6fa0a0a2d7f2b1e617?d=identicon&s=25 Ross Bamford (Guest)
on 2006-01-06 01:10
(Received via mailing list)
On Thu, 05 Jan 2006 22:48:07 -0000, <gwtmp01@mac.com> wrote:

>
> I think in a very deep, conceptual way, Ruby symbols behave like names
> just as Ruby fixnums behave like integers.
>

That's exactly the kind of feeling I was going with when I made that
naive
'Symbols are names' comment way back when. You put it into words better
than I ever could :)

Cheers,
B000982a23d5c6a34292902caf225dd7?d=identicon&s=25 Yohanes Santoso (Guest)
on 2006-01-06 16:24
(Received via mailing list)
"Ross Bamford" <rosco@roscopeco.remove.co.uk> writes:

>
> Cheers,
>
> --
> Ross Bamford - rosco@roscopeco.remove.co.uk

It's not naive and it's closer to the truth then other descriptions so
far. However, it seems for some people the concept of being able to
represent names directly seems scary and foreign. Probably due to the
numerous years of working with languages that have imporverished
language constructs.

It is the same concept of being able to represent integers directly,
but since most languages allow direct integer representations, it is
not perceived as scary and foreign.

Why would they care about how Symbol is implemented is beyond me, as
if knowing how Fixnum is implemented would enhance their understanding
of what an integer is and how to appropriately use it.

YS.
This topic is locked and can not be replied to.