all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Symbol Properties having global context
@ 2020-12-06 20:09 Christopher Dimech
  2020-12-06 20:13 ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher Dimech @ 2020-12-06 20:09 UTC (permalink / raw)
  To: Help Gnu Emacs

Am reading the section "9.4 Symbol Properties".  The section that not say that
symbol properties such as "value" have a global context.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Symbol Properties having global context
  2020-12-06 20:09 Symbol Properties having global context Christopher Dimech
@ 2020-12-06 20:13 ` Drew Adams
  2020-12-06 20:25   ` Christopher Dimech
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2020-12-06 20:13 UTC (permalink / raw)
  To: Christopher Dimech, Help Gnu Emacs

> Am reading the section "9.4 Symbol Properties".  The section that not
> say that
> symbol properties such as "value" have a global context.

It is symbols themselves that are global objects.
It follows that their property values are also.

(Of course, a Lisp value can be shared.)

Symbols are stored in obarrays.  By default, they
are stored in the obarray that is the value of
global variable `obarray'.

So you can have two symbols with the same name
(the name is just one of a symbols properties,
its `symbol-name'), but which have different
values for other properties, such as
`symbol-value'.

E.g., you can have two symbols `foo', in two
different obarrays, with two different values
when used as a variable.  (They can also have
different `symbol-function' value, etc.)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RE: Symbol Properties having global context
  2020-12-06 20:13 ` Drew Adams
@ 2020-12-06 20:25   ` Christopher Dimech
  2020-12-06 23:01     ` Drew Adams
  2020-12-06 23:52     ` Michael Heerdegen
  0 siblings, 2 replies; 6+ messages in thread
From: Christopher Dimech @ 2020-12-06 20:25 UTC (permalink / raw)
  To: Drew Adams; +Cc: Help Gnu Emacs

I got to "9.2 Defining Symbols".  It only mentions that defvar and defconst
define a symbol as a global variable.

Could something be written and your comments were very enlightening.

> Sent: Sunday, December 06, 2020 at 9:13 PM
> From: "Drew Adams" <drew.adams@oracle.com>
> To: "Christopher Dimech" <dimech@gmx.com>, "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: RE: Symbol Properties having global context
>
> > Am reading the section "9.4 Symbol Properties".  The section that not
> > say that
> > symbol properties such as "value" have a global context.
>
> It is symbols themselves that are global objects.
> It follows that their property values are also.
>
> (Of course, a Lisp value can be shared.)
>
> Symbols are stored in obarrays.  By default, they
> are stored in the obarray that is the value of
> global variable `obarray'.
>
> So you can have two symbols with the same name
> (the name is just one of a symbols properties,
> its `symbol-name'), but which have different
> values for other properties, such as
> `symbol-value'.
>
> E.g., you can have two symbols `foo', in two
> different obarrays, with two different values
> when used as a variable.  (They can also have
> different `symbol-function' value, etc.)
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: RE: Symbol Properties having global context
  2020-12-06 20:25   ` Christopher Dimech
@ 2020-12-06 23:01     ` Drew Adams
  2020-12-06 23:20       ` Christopher Dimech
  2020-12-06 23:52     ` Michael Heerdegen
  1 sibling, 1 reply; 6+ messages in thread
From: Drew Adams @ 2020-12-06 23:01 UTC (permalink / raw)
  To: Christopher Dimech; +Cc: Help Gnu Emacs

> I got to "9.2 Defining Symbols".  It only mentions that defvar and
> defconst define a symbol as a global variable.
> 
> Could something be written and your comments were very enlightening.

If you got to 9.2 then you likely passed through 9 and 9.1.
9.1 tells you about symbol properties, and functions `symbol-name',
`symbol-function', and `symbol-plist'.  It also tells you about the
value cell (but it neglects mentioning function `symbol-value').

9.3 tells you about obarrays and `symbol-value'.  9.4.1 tells you
about getting and setting symbol properties.  And so on.

`i' in Info is your friend.  It has all of these completions for
`symbol' in the Elisp manual:

symbol
symbol components
symbol equality
symbol evaluation 
symbol forms
symbol function indirection
symbol in keymap
symbol name hashing 
symbol property
symbol that evaluates to itself
symbol with constant value 
symbol, where defined
symbol-file
symbol-function
symbol-name 
symbol-plist
symbol-value
symbolic links
symbolic links <1> 
symbolp
symbols-consed

And if you have substring completion there are more than
twice that number of completions of `symbol'.

Another friend: `M-x apropos'.  With input `symbol' it
shows you a ton of relevant user options, other variables,
commands, non-interactive functions, and macros about
symbols.  Enter additional keywords for more focus.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Symbol Properties having global context
  2020-12-06 23:01     ` Drew Adams
@ 2020-12-06 23:20       ` Christopher Dimech
  0 siblings, 0 replies; 6+ messages in thread
From: Christopher Dimech @ 2020-12-06 23:20 UTC (permalink / raw)
  To: Drew Adams; +Cc: Help Gnu Emacs


> Sent: Monday, December 07, 2020 at 12:01 AM
> From: "Drew Adams" <drew.adams@oracle.com>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: RE: RE: Symbol Properties having global context
>
> > I got to "9.2 Defining Symbols".  It only mentions that defvar and
> > defconst define a symbol as a global variable.
> >
> > Could something be written and your comments were very enlightening.
>
> If you got to 9.2 then you likely passed through 9 and 9.1.
> 9.1 tells you about symbol properties, and functions `symbol-name',
> `symbol-function', and `symbol-plist'.  It also tells you about the
> value cell (but it neglects mentioning function `symbol-value').

I was only referring to a comment about symbol properties being global.
 Perhaps it is said somewhere, but cannot quite locate the place exactly.

> 9.3 tells you about obarrays and `symbol-value'.  9.4.1 tells you
> about getting and setting symbol properties.  And so on.
>
> `i' in Info is your friend.  It has all of these completions for
> `symbol' in the Elisp manual:
>
> symbol
> symbol components
> symbol equality
> symbol evaluation
> symbol forms
> symbol function indirection
> symbol in keymap
> symbol name hashing
> symbol property
> symbol that evaluates to itself
> symbol with constant value
> symbol, where defined
> symbol-file
> symbol-function
> symbol-name
> symbol-plist
> symbol-value
> symbolic links
> symbolic links <1>
> symbolp
> symbols-consed
>
> And if you have substring completion there are more than
> twice that number of completions of `symbol'.
>
> Another friend: `M-x apropos'.  With input `symbol' it
> shows you a ton of relevant user options, other variables,
> commands, non-interactive functions, and macros about
> symbols.  Enter additional keywords for more focus.
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Symbol Properties having global context
  2020-12-06 20:25   ` Christopher Dimech
  2020-12-06 23:01     ` Drew Adams
@ 2020-12-06 23:52     ` Michael Heerdegen
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Heerdegen @ 2020-12-06 23:52 UTC (permalink / raw)
  To: help-gnu-emacs

Christopher Dimech <dimech@gmx.com> writes:

> I got to "9.2 Defining Symbols".  It only mentions that defvar and
> defconst define a symbol as a global variable.

This is again the "global" which is the counterpart of "local variable
(in a function or `let'), not the "global" which is the counterpart of
"buffer local".

When the manual talks about a "global" variable it typically uses it in
the first meaning, apart from the few pages that speak about buffer
local variables.

Michael.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-06 23:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-06 20:09 Symbol Properties having global context Christopher Dimech
2020-12-06 20:13 ` Drew Adams
2020-12-06 20:25   ` Christopher Dimech
2020-12-06 23:01     ` Drew Adams
2020-12-06 23:20       ` Christopher Dimech
2020-12-06 23:52     ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.