all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Confusion about elisp symbols and defuns
@ 2014-09-24  7:23 H. Dieter Wilhelm
  2014-09-24  9:18 ` Nicolas Richard
  0 siblings, 1 reply; 3+ messages in thread
From: H. Dieter Wilhelm @ 2014-09-24  7:23 UTC (permalink / raw)
  To: help-gnu-emacs

Hello (),

Calc checks in calc-var-value if variables are bound.  This works for
examplwe with the variable symbol `g'

(calc-var-value 'g)
nil

but bombs for the variable `v'

(calc-var-value 'v)
=> error

The reason seems to me that somehow over the parameter name (v) of the
defun the symbol `v' becomes bound.  (Excuse my layman interpretation.)

(makunbound 'g)
g

(makunbound 'v)
v

(symbolp 'v)
t

(boundp 'v)
nil

(boundp 'g)
nil

(defun bla (v)
  (boundp v))
bla

(bla 'g)
nil

(bla 'v)
t

(defun foo (v)
  (makunbound v)
  (boundp v))
foo

(foo 'g)
nil

(foo 'v)
=> error signal


How would you change the calc-var-value to avoid this trap?

Thanks for any enlightenment

       Dieter
-- 
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany




^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <mailman.9462.1411543422.1147.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2014-09-24 12:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24  7:23 Confusion about elisp symbols and defuns H. Dieter Wilhelm
2014-09-24  9:18 ` Nicolas Richard
     [not found] <mailman.9462.1411543422.1147.help-gnu-emacs@gnu.org>
2014-09-24 12:51 ` Stefan Monnier

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.