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

> > You're calling for deep trouble. (Hint: Symols are part of a program
> > source code.)
> 
> Symbols are but why their name are ? symbol & name should be distinct.

Because if symbols and their names are distinct, then you lose the
ability to reliably map from symbol names to symbols.  That is the
fundamental reason why symbol names cannot be altered.  It would be
really bad if the following happened:

(setq a (read-from-string "FOO"))

(setf (symbol-name a) "Foo")

(setq b (read-from-string "FOO"))

(eq a b) => NIL

You want the mapping to be immutable.

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

From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <4170e1f5$0$25713$636a15ce@news.free.fr>
"Thomas A. Russ" <···@sevak.isi.edu> a �crit dans le message de
····················@sevak.isi.edu...
> "Christophe Turle" <······@nospam.com> writes:
>
> > > You're calling for deep trouble. (Hint: Symols are part of a program
> > > source code.)
> >
> > Symbols are but why their name are ? symbol & name should be distinct.
>
> Because if symbols and their names are distinct, then you lose the
> ability to reliably map from symbol names to symbols.  That is the
> fundamental reason why symbol names cannot be altered.  It would be
> really bad if the following happened:
>
> (setq a (read-from-string "FOO"))
>
> (setf (symbol-name a) "Foo")

I think you mean (setf (symbol-name 'FOO) "Foo")
so now a => |Foo|

>
> (setq b (read-from-string "FOO"))
>
> (eq a b) => NIL

Yes and it appears coherent. View these forms as typed form the REPL one by
one. Not in a file (use an editor for this ;) ).

>
> You want the mapping to be immutable.
>

Me ? no ;)

If it was possible you would be able to do more things not less. So in any
case you won't be forced to use it. Of course, implementations have to be
revamped...

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

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html
From: jayessay
Subject: Re: changing a symbol name
Date: 
Message-ID: <m3fz4e3hgn.fsf@rigel.goldenthreadtech.com>
"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:
> >
> > > > You're calling for deep trouble. (Hint: Symols are part of a program
> > > > source code.)
> > >
> > > Symbols are but why their name are ? symbol & name should be distinct.
> >
> > Because if symbols and their names are distinct, then you lose the
> > ability to reliably map from symbol names to symbols.  That is the
> > fundamental reason why symbol names cannot be altered.  It would be
> > really bad if the following happened:
> >
> > (setq a (read-from-string "FOO"))
> >
> > (setf (symbol-name a) "Foo")
> 
> I think you mean (setf (symbol-name 'FOO) "Foo")

The symbol FOO is the value of a, so (symbol-name a) == (symbol-name 'foo)

> so now a => |Foo|

No, the value of a is still the same _symbol_, but with a different
UID than before.


> > (setq b (read-from-string "FOO"))
> >
> > (eq a b) => NIL
> 
> Yes and it appears coherent.

Actually it appears quite incoherent because you now have two symbols
which originally had the same UID, but now do not.  Any time you have
a UID map to different things, you are basically in trouble.

Make sure you get a grip on the fact that the internal id (for the
sake of conversation let's say this is the machine address, i.e., the
thing that eq will compare) is _not_ the UID of the symbols.  The UID
is the fully qualified _name_.  This is a big deal and you certainly
don't appear to have a grip on it.

You need to have a UID for symbols for things to work.  A symbol's UID
needs to be fixed no matter when you encounter _the_ symbol, where you
encounter _the_ symbol, nor the order you encounter _the_ symbol.

You also really really really should have this UID be human readable
and useable, and that is why the fully qualified _name_ is used for
such UIDs in Common Lisp.


> > You want the mapping to be immutable.
> >
> 
> Me ? no ;)

That's because you don't understand that the _name_ is the UID.


> If it was possible you would be able to do more things not less.

Presumably you'd also love to have a contradiction lurking in the
foundations of mathematics.  Afterall, you can then do _anything_,
which is clearly a _lot_ more than you can if there isn't one.


/Jon

-- 
'j' - a n t h o n y at romeo/charley/november com
From: Christophe Turle
Subject: Re: changing a symbol name
Date: 
Message-ID: <4171947a$0$25724$636a15ce@news.free.fr>
"jayessay" <······@foo.com> a �crit dans le message de
···················@rigel.goldenthreadtech.com...
> "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:
> > >
> > > > > You're calling for deep trouble. (Hint: Symols are part of a
program
> > > > > source code.)
> > > >
> > > > Symbols are but why their name are ? symbol & name should be
distinct.
> > >
> > > Because if symbols and their names are distinct, then you lose the
> > > ability to reliably map from symbol names to symbols.  That is the
> > > fundamental reason why symbol names cannot be altered.  It would be
> > > really bad if the following happened:
> > >
> > > (setq a (read-from-string "FOO"))
> > >
> > > (setf (symbol-name a) "Foo")
> >
> > I think you mean (setf (symbol-name 'FOO) "Foo")
>
> The symbol FOO is the value of a, so (symbol-name a) == (symbol-name 'foo)
>
> > so now a => |Foo|
>
> No, the value of a is still the same _symbol_, but with a different
> UID than before.

If it was really what you meant, you will be on trouble later. Let's see why
:

Let's take the notation [symbol-name symbol symbol-value]

>> (setq a (read-from-string "FOO")) is like :

(setq ["A" a unbound] ["FOO" foo unbound])
=> ["A" a ["FOO" foo unbound]]

>> (setf (symbol-name a) "Foo") is like :

(setf (symbol-name ["A" a ["FOO" foo unbound]]) "Foo")
=> ["Foo" a ["FOO" foo unbound]]

>> (setq b (read-from-string "FOO")) is like :

(setq ["B" b unbound] ["FOO" foo unbound])
=> ["B" b ["FOO" foo unbound]]

now you are on trouble since there's no symbol named "A"

>>> (eq a b) is like :

(eq ["A" a2 unbound] ["B" b ["FOO" foo unbound]])
=> error : A is unbound

and not

>>  => NIL


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

sava preview : http://perso.wanadoo.fr/turle/lisp/sava.html
From: Vassil Nikolov
Subject: Re: changing a symbol name
Date: 
Message-ID: <lzzn2kzqqt.fsf@janus.vassil.nikolov.names>
jayessay <······@foo.com> writes:

> [...]
> Presumably you'd also love to have a contradiction lurking in the
> foundations of mathematics.  Afterall, you can then do _anything_

  Or perhaps, "prove anything, and do nothing"...

  ---Vassil.

-- 
Vassil Nikolov <········@poboxes.com>

Hollerith's Law of Docstrings: Everything can be summarized in 72 bytes.
From: jayessay
Subject: Re: changing a symbol name
Date: 
Message-ID: <m3sm8c0wfv.fsf@rigel.goldenthreadtech.com>
Vassil Nikolov <········@poboxes.com> writes:

> jayessay <······@foo.com> writes:
> 
> > [...]
> > Presumably you'd also love to have a contradiction lurking in the
> > foundations of mathematics.  Afterall, you can then do _anything_
> 
>   Or perhaps, "prove anything, and do nothing"...

I like that better, and it is even more apropos to the context...


/Jon

-- 
'j' - a n t h o n y at romeo/charley/november com