Nп/п : 65 из 93
 От   : Kaz Kylheku                         2:5075/128        04 сен 23 15:56:05
 К    : none) (albert                                         04 сен 23 18:59:01
 Тема : Re: What does (gensym) generate?
----------------------------------------------------------------------------------
                                                                                 
@MSGID: <20230904084412.969@kylheku.com> d0d1588e
@REPLY:
a9d45092
@REPLYADDR Kaz Kylheku <864-117-4973@kylheku.com>
@REPLYTO 2:5075/128 Kaz Kylheku
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: <20230904084412.969@kylheku.com>
@RFC-References:
<20230831104914.534@kylheku.com>
<8GRTwaqPt+TSAYagO@bongo-ra.co>
@TZUTC: -0000
@PID: slrn/pre1.0.4-9 (Linux)
@TID: FIDOGATE-5.12-ge4e8b94
On 2023-09-04, albert@cherry.(none) (albert)  wrote:
> In article <8GRTwaqPt+TSAYagO@bongo-ra.co>,
> Spiros Bousbouras  <spibou@gmail.com> wrote:
>>On Fri, 01 Sep 2023 14:23:21 +0200
>>albert@cherry.(none) (albert) wrote:
>>> In article <20230831104914.534@kylheku.com>,
>>> Kaz Kylheku  <864-117-4973@kylheku.com> wrote:
>>> >On 2023-08-31, albert@cherry.(none) (albert)  wrote:
>>
>>[...]
>>
>>
>>(let ((aaa (foo))))   binds  aaa  to whatever  (foo)  returns. As
>>far as this goes there is nothing special with something like
>>(let ((aaa (gensym)))) . aaa  gets bound to whatever  (gensym)
>>returned much like  (let ((aaa (+ 1 1))))  binds  aaa  to whatever
>>(+ 1 1)  returns which is 2.
>>
>>(gensym)  returns a symbol with the special property that it is
>>uninterned. So the only reference to the symbol returned is through
>>aaa .There is nothing you can type on the REPL to get the same
>>symbol {although you can get a symbol with the same name} and every
>>other call to  gensym  will also return a different symbol.
>
> Remember that my big question was,what is the type of the value
> `aaa is bound to. So apparently that is a symbol that has
> uninterned.
> Can you please elaborate what uninterned means?

Uninterned means "not remembered by name for the purposes of 
turning the same syntactic tokeen into the same symbol object".

Interning refers to turning multiple occurrences of an identifier
in the printed notation into references to the same symbol,
rather than distinct symbols. When (x x x) is read, there
are three references to the same symbol x, because of interning.

An uninterned symol is created without entering it into the dictionary
of interned symbols. Because it`s newly created, it`s a distinct object
from any other object, and because it`s not interned, it cannot be found
by name. You cannot possibly read any object from text that would
contain that uninterned symbol.

> It is clear that you can have a symbol that is floating around
> and has not been placed in abstract structure tree or a
> hash table. Is that uninterned?

Yes, if by that hash table you refer to the structure that is used
to identify (x x x) has having the same symbol three times,
rather than three symbols.

(In ANSI Common Lisp, which has a package system, that table is the
package. Packages themselves are named: there is more than one package.)
--- slrn/pre1.0.4-9 (Linux)
 * Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх