From: David Vazquez Date: Mon, 17 Dec 2012 19:11:12 +0000 (+0000) Subject: Avoid redeclarate variable and functions X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=52ef3ac96a027a87b483694baafdda5f6cdba4c1;p=jscl.git Avoid redeclarate variable and functions --- diff --git a/lispstrack.lisp b/lispstrack.lisp index a9fba97..de2cbf9 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -453,12 +453,14 @@ (defun %compile-defvar (name) - (push (make-var-binding name) *env*) - (push (concat "var " (lookup-variable name *env*)) *toplevel-compilations*)) + (unless (lookup-variable name *env*) + (push (make-var-binding name) *env*) + (push (concat "var " (lookup-variable name *env*)) *toplevel-compilations*))) (defun %compile-defun (name) - (push (make-func-binding name) *fenv*) - (push (concat "var " (lookup-variable name *fenv*)) *toplevel-compilations*)) + (unless (lookup-variable name *fenv*) + (push (make-func-binding name) *fenv*) + (push (concat "var " (lookup-variable name *fenv*)) *toplevel-compilations*))) (defun %compile-defmacro (name lambda) (push (cons name (cons 'macro lambda)) *fenv*))