From: David Vázquez Date: Tue, 14 May 2013 14:33:43 +0000 (+0100) Subject: Symbol could refer special variable X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=055e4b3bbea33e0d0053216c831b37464d5e0569;p=jscl.git Symbol could refer special variable --- diff --git a/experimental/compiler.lisp b/experimental/compiler.lisp index 380333c..6ef083b 100644 --- a/experimental/compiler.lisp +++ b/experimental/compiler.lisp @@ -571,8 +571,10 @@ (setf)))) (defun ir-convert-var (form result) - (let* ((leaf (make-var :name form))) - (insert-node (make-ref :leaf leaf :lvar result)))) + (let ((binds (find-binding form 'variable))) + (if binds + (insert-node (make-ref :leaf (binding-value binds) :lvar result)) + (ir-convert `(symbol-value ',form) result)))) (defun ir-convert-call (form result) (destructuring-bind (function &rest args) form @@ -768,6 +770,7 @@ (find name *primitive-function-table* :key #'primitive-name)) (define-primitive symbol-function (symbol)) +(define-primitive symbol-value (symbol))