DECLAIM + SPECIAL did not work because ECL was not looking for special declarations in the compiler environment.

This commit is contained in:
Juan Jose Garcia Ripoll 2010-05-05 23:27:43 +02:00
parent 557474044f
commit c8c36d32b9
2 changed files with 7 additions and 3 deletions

View file

@ -25,12 +25,12 @@
(loop for name in specials
unless (assoc name types)
do (let ((v (c1make-global-variable name :kind 'special)))
(setf env (cmp-env-register-var v env))))
(setf env (cmp-env-register-var v env nil))))
(loop for (name . type) in types
for specialp = (or (sys:specialp name) (member name specials))
for kind = (if specialp 'SPECIAL 'GLOBAL)
for v = (c1make-global-variable name :type type :kind kind)
do (setf env (cmp-env-register-var v env)))
do (setf env (cmp-env-register-var v env nil)))
env))
(multiple-value-bind (body specials types ignored others doc all)
(c1body `((DECLARE ,@args)) nil)

View file

@ -101,7 +101,11 @@
;;; value.
(defun check-global (name)
(member name *global-vars* :test #'eq :key #'var-name))
(or (member name *global-vars* :test #'eq :key #'var-name)
(let ((v (cmp-env-search-var name)))
;; Fixme! Revise the declamation code to ensure whether
;; we also have to consider 'GLOBAL here.
(and v (eq (var-kind v) 'SPECIAL)))))
;;;
;;; Check if the symbol has a symbol macro