From 055e4b3bbea33e0d0053216c831b37464d5e0569 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Tue, 14 May 2013 15:33:43 +0100 Subject: [PATCH] Symbol could refer special variable --- experimental/compiler.lisp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)) -- 1.7.10.4