Do not complain when a global function is closed over.

This commit is contained in:
Juan Jose Garcia Ripoll 2010-02-23 16:52:01 +01:00
parent 6b1e70042e
commit 7f52387b73
4 changed files with 12 additions and 12 deletions

View file

@ -141,8 +141,8 @@
;; All external, non-global variables become of type closure
(when (eq new-type 'CLOSURE)
(when (fun-global fun)
(cmperr "Function ~A is global but is closed over some variables.~%~{~A ~}"
(fun-name fun) (mapcar #'var-name (fun-referred-vars fun))))
(cmpnote "Function ~A is global but is closed over some variables.~%~{~A ~}"
(fun-name fun) (mapcar #'var-name (fun-referred-vars fun))))
(dolist (var (fun-referred-local-vars fun))
(setf (var-ref-clb var) nil
(var-ref-ccb var) t

View file

@ -138,10 +138,10 @@ The function thus belongs to the type of functions that ecl_make_cfun accepts."
(setf finish nil))))
(compute-fun-closure-type fun)
(when global
(when (fun-closure fun)
(cmperr "Function ~A is global but is closed over some variables.~%~{~A ~}"
(fun-name fun) (mapcar #'var-name (fun-referred-vars fun))))
(new-defun fun (fun-no-entry fun))))
(if (fun-closure fun)
(cmpnote "Function ~A is global but is closed over some variables.~%~{~A ~}"
(fun-name fun) (mapcar #'var-name (fun-referred-vars fun)))
(new-defun fun (fun-no-entry fun)))))
fun)
(defun cmp-process-lambda-list (list)

View file

@ -174,8 +174,8 @@
;; All external, non-global variables become of type closure
(when (eq new-type 'CLOSURE)
(when (fun-global fun)
(cmperr "Function ~A is global but is closed over some variables.~%~{~A ~}"
(fun-name fun) (mapcar #'var-name (fun-referred-vars fun))))
(cmpnote "Function ~A is global but is closed over some variables.~%~{~A ~}"
(fun-name fun) (mapcar #'var-name (fun-referred-vars fun))))
(dolist (var (fun-referred-local-vars fun))
(setf (var-ref-clb var) nil
(var-ref-ccb var) t

View file

@ -141,10 +141,10 @@
(setf finish nil))))
(compute-fun-closure-type fun)
(when (fun-global fun)
(when (fun-closure fun)
(cmperr "Function ~A is global but is closed over some variables.~%~{~A ~}"
(fun-name fun) (mapcar #'var-name (fun-referred-vars fun))))
(new-defun fun (fun-no-entry fun)))))
(if (fun-closure fun)
(cmpnote "Function ~A is global but is closed over some variables.~%~{~A ~}"
(fun-name fun) (mapcar #'var-name (fun-referred-vars fun)))
(new-defun fun (fun-no-entry fun))))))
(defun c1lambda-expr (fun lambda-expr CB/LB