unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Question reg. docstring of symbol-value
@ 2021-11-02 20:52 Arash Esbati
  2021-11-02 20:59 ` Robin Tarsiger
  0 siblings, 1 reply; 3+ messages in thread
From: Arash Esbati @ 2021-11-02 20:52 UTC (permalink / raw)
  To: emacs-devel; +Cc: Keita Ikumi, Tassilo Horn

Hi all,

me and my fellow AUCTeX maintainers stumbled over the docstring of
`symbol-value' which says:

,----[ C-h f symbol-value RET ]
| symbol-value is a built-in function in ‘C source code’.
| 
| (symbol-value SYMBOL)
| 
| Return SYMBOL’s value.  Error if that is void.
| Note that if ‘lexical-binding’ is in effect, this returns the
| global value outside of any lexical scope.
`----

How does the last sentence fit to these two examples (eval'ed in
*scratch*):

--8<---------------cut here---------------start------------->8---
(defvar foo 1)
(let ((foo foo))
  (setq foo (1+ foo))
  (symbol-value 'foo))
;; => 2


(setq bar 1)
(let ((bar bar))
  (setq bar (1+ bar))
  (symbol-value 'bar))
;; => 1
--8<---------------cut here---------------end--------------->8---

Is the intention to say "..., this returns the global value outside of
any lexical scope for symbols not marked as special" or something like
that?  Or am I missing something?

Best, Arash



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

end of thread, other threads:[~2021-11-03  7:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-02 20:52 Question reg. docstring of symbol-value Arash Esbati
2021-11-02 20:59 ` Robin Tarsiger
2021-11-03  7:38   ` Tassilo Horn

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).