Changeset 9052 for trunk/source/compiler/nx0.lisp
- Timestamp:
- Apr 8, 2008, 4:52:04 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/compiler/nx0.lisp
r9027 r9052 2143 2143 2144 2144 2145 ; This guy has to return multiple values.2146 ; The arguments havealready been transformed; if they're all constant (or quoted), try2147 ; to evaluate the expression at compile-time.2145 ;;; This guy has to return multiple values. The arguments have 2146 ;;; already been transformed; if they're all constant (or quoted), try 2147 ;;; to evaluate the expression at compile-time. 2148 2148 (defun nx-constant-fold (original-call &optional (environment *nx-lexical-environment*) &aux 2149 2149 (fn (car original-call)) form mv foldable foldfn) … … 2161 2161 (funcall foldfn original-call environment) 2162 2162 (progn 2163 (let ((args nil)) 2164 (dolist (arg (cdr original-call) (setq args (nreverse args))) 2165 (if (quoted-form-p arg) 2166 (setq arg (%cadr arg)) 2167 (unless (self-evaluating-p arg) (return-from nx-constant-fold (values original-call nil)))) 2168 (push arg args)) 2163 (let ((args nil)) 2164 (dolist (arg (cdr original-call) (setq args (nreverse args))) 2165 (if (quoted-form-p arg) 2166 (setq arg (%cadr arg)) 2167 (unless (self-evaluating-p arg) (return-from nx-constant-fold (values original-call nil)))) 2168 (push arg args)) 2169 (if (nx1-check-call-args (fboundp fn) args nil) 2170 (return-from nx-constant-fold (values original-call nil)) 2169 2171 (setq form (multiple-value-list 2170 (handler-case (apply fn args)2171 (error (condition)2172 (warn "Error: \"~A\" ~&signalled during compile-time evaluation of ~S ."2173 condition original-call)2174 (return-from nx-constant-fold2175 (values `(locally (declare (notinline ,fn))2176 ,original-call)2177 t)))))))2172 (handler-case (apply fn args) 2173 (error (condition) 2174 (warn "Error: \"~A\" ~&signalled during compile-time evaluation of ~S ." 2175 condition original-call) 2176 (return-from nx-constant-fold 2177 (values `(locally (declare (notinline ,fn)) 2178 ,original-call) 2179 t)))))))) 2178 2180 (if form 2179 2181 (if (null (%cdr form))
Note: See TracChangeset
for help on using the changeset viewer.