CONSTANT-EXPRESSION-P now checks whether the 1-form is pure before checking the arguments.

This commit is contained in:
Juan Jose Garcia Ripoll 2013-01-10 00:54:08 +01:00
parent 67c76f0ad4
commit faa39d2f50

View file

@ -17,12 +17,12 @@
(defun constant-expression-p (form &optional (env *cmp-env*))
(or (constantp form env)
(and (consp form)
(loop for c in (rest form)
always (constant-expression-p c env))
(let ((head (car form)))
(let ((head (car form)))
(or (member head '(IF OR AND NULL NOT PROGN))
(and (get-sysprop head 'pure)
(inline-possible head)))))))
(inline-possible head))))
(loop for c in (rest form)
always (constant-expression-p c env)))))
(defun extract-constant-value (form &optional failure (env *cmp-env*))
(if (constant-expression-p form env)