From: Thomas A. Russ
Subject: Re: changing a symbol name
Date: 
Message-ID: <ymid5zjaosp.fsf@sevak.isi.edu>
"Christophe Turle" <······@nospam.com> writes:

> If someone has put the symbol name in a hashtable, it is bad design. The key
> should have been the symbol not its representation.

But how do you get a reference to a symbol?  How do you find the symbol
to use as the key to your hash table?  The reader does this by knowing
how to map a name to a particular symbol, and if you go about changing
this name, then massive confusion results.

Either you have the same name mapping to different symbols, or you have
different names mapping to the same symbol, or perhaps even both.

-- 
Thomas A. Russ,  USC/Information Sciences Institute

From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <4170e2fc$0$25710$636a15ce@news.free.fr>
"Thomas A. Russ" <···@sevak.isi.edu> a �crit dans le message de
····················@sevak.isi.edu...
> "Christophe Turle" <······@nospam.com> writes:
>
> > If someone has put the symbol name in a hashtable, it is bad design. The
key
> > should have been the symbol not its representation.
>
> But how do you get a reference to a symbol?  How do you find the symbol
> to use as the key to your hash table?  The reader does this by knowing
> how to map a name to a particular symbol, and if you go about changing
> this name, then massive confusion results.

third time :) 'someone' is for 'users'. I know there is the read hashtable.
But i think it is the only one.

> Either you have the same name mapping to different symbols,

No.

> or you have
> different names mapping to the same symbol, or perhaps even both.

Yes. And perhaps it's cool : no more need for abbrev macros for example...


___________________________________________________________
Christophe Turle.
(format nil ···@~S.~S" 'c.turle 'wanadoo 'fr)

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html
From: Thomas A. Russ
Subject: Re: changing a symbol name
Date: 
Message-ID: <ymibrezaeg6.fsf@sevak.isi.edu>
"Christophe Turle" <······@nospam.com> writes:

> 
> "Thomas A. Russ" <···@sevak.isi.edu> a �crit dans le message de
> ····················@sevak.isi.edu...
> > "Christophe Turle" <······@nospam.com> writes:
> >
> > > If someone has put the symbol name in a hashtable, it is bad design. The
> key
> > > should have been the symbol not its representation.
> >
> > But how do you get a reference to a symbol?  How do you find the symbol
> > to use as the key to your hash table?  The reader does this by knowing
> > how to map a name to a particular symbol, and if you go about changing
> > this name, then massive confusion results.
> 
> third time :) 'someone' is for 'users'. I know there is the read hashtable.
> But i think it is the only one.
> 
> > Either you have the same name mapping to different symbols,
> 
> No.

Really?  What magic accomplishes this?

Suppose we create a symbol S1 with name "FOO" and then create another
symbol S2 with name "Foo".

Then we change the name of S1 to be "Foo" as well.

If we then want the symbol named "Foo", which one do we get?  S1 or S2?

The whole point of interned symbols in lisp is that there is an
unambiguous mapping from fully-qualified names to symbols.

(Because of import and its ilk, there may in fact be multiple fully
qualified names that map to the same symbol using different package
prefixes, but the name part is fixed.)

Hmmm, I just had a thought.  If you don't want to have the names of
symbols map to the symbols, perhaps what you really want are uninterned
symbols.  I somehow don't think this is really what you want, but I
don't see how else you can assure that you get the symbol you want when
you or anyone else can change the mapping from the text representation
at will.

> > or you have
> > different names mapping to the same symbol, or perhaps even both.
> 
> Yes. And perhaps it's cool : no more need for abbrev macros for
> example...

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <41751d8b$0$28196$636a15ce@news.free.fr>
"Thomas A. Russ" <···@sevak.isi.edu> a �crit dans le message de
····················@sevak.isi.edu...
> "Christophe Turle" <······@nospam.com> writes:
>
> >
> > "Thomas A. Russ" <···@sevak.isi.edu> a �crit dans le message de
> > ····················@sevak.isi.edu...
> > > "Christophe Turle" <······@nospam.com> writes:
> > >
> > > > If someone has put the symbol name in a hashtable, it is bad design.
The
> > key
> > > > should have been the symbol not its representation.
> > >
> > > But how do you get a reference to a symbol?  How do you find the
symbol
> > > to use as the key to your hash table?  The reader does this by knowing
> > > how to map a name to a particular symbol, and if you go about changing
> > > this name, then massive confusion results.
> >
> > third time :) 'someone' is for 'users'. I know there is the read
hashtable.
> > But i think it is the only one.
> >
> > > Either you have the same name mapping to different symbols,
> >
> > No.
>
> Really?  What magic accomplishes this?
>
> Suppose we create a symbol S1 with name "FOO" and then create another
> symbol S2 with name "Foo".

ok: ["FOO" S1] and ["Foo" S2]

> Then we change the name of S1 to be "Foo" as well.

(setf (symbol-name 'FOO) "Foo")
=> error the name "Foo" is already assigned to a symbol.

> If we then want the symbol named "Foo", which one do we get?  S1 or S2?
>
> The whole point of interned symbols in lisp is that there is an
> unambiguous mapping from fully-qualified names to symbols.

My proposition is ( name 1-* <-> 0-1 symbol ) so name -> symbol is non
ambigous.

> Hmmm, I just had a thought.  If you don't want to have the names of
> symbols map to the symbols, perhaps what you really want are uninterned
> symbols.  I somehow don't think this is really what you want, but I
> don't see how else you can assure that you get the symbol you want when
> you or anyone else can change the mapping from the text representation
> at will.

Your 'at will' is strong. It means we will do that over and over confusing
every one reading your code. I'm just seeing this as a 'sometime used/useful
feature'.

-- 
___________________________________________________________
Christophe Turle.
http://perso.wanadoo.fr/turle/lisp/utilities.html
(format nil ···@~a.~a" 'c.turle 'wanadoo 'fr)