[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Confusion about elisp symbols and defuns
From: |
H. Dieter Wilhelm |
Subject: |
Confusion about elisp symbols and defuns |
Date: |
Wed, 24 Sep 2014 09:23:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux) |
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
- Confusion about elisp symbols and defuns,
H. Dieter Wilhelm <=