guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: intern a top level variable


From: Jean Abou Samra
Subject: Re: Re: intern a top level variable
Date: Sun, 20 Aug 2023 15:56:15 +0200
User-agent: Evolution 3.48.4 (3.48.4-1.fc38)

Le mercredi 16 août 2023 à 15:17 -0400, Mortimer Cladwell a écrit :
> I would like to define a variable within a method but make it available to the
> entire module - globally. [...]
> So yes I will need to read more about interning.


OK, so the reason we were all confused is that "interning" is an unrelated
concept that has absolutely nothing to do with what you were looking for here.

Symbol interning is what makes this true:

(eq? 'foobar 'foobar)

Namely, it's the fact that whenever a symbol is created, if there is already
another symbol with the same name, that symbol object is reused.

It's not the same as defining variables. A symbol is not a variable, just the
name for a variable. Interning applies to symbols, which also happen to be the
objects used to name variables, but creating a symbol does not create a
variable, just like when I say "John is an English name", it doesn't make
someone named John appear in the room :)

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]