Es una pregunta acerca unen variable en función de definir:una pregunta sobre bind variable en Common Lisp
Si defino funcion "total" de este tipo, x en "total" se unen a los x locales en let.
CL-USER> (let ((x 0))
(defun total (y)
(incf x y)))
TOTAL
CL-USER> (defvar x 10000)
X
CL-USER> (total 1)
1
pero, si defino "total" de este tipo, x se unen a x globales en defvar:
CL-USER> (defvar x 10000)
X
CL-USER> (let ((x 0))
(defun total (y)
(incf x y)))
TOTAL
CL-USER> (total 1)
10001
¿Por qué esto? Necesito una explicación para entenderlo. el entorno es windows + emacs + slime + sbcl.Gracias.
Gracias por su ayuda! – luosha865