X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Flambda-list.pure.lisp;h=3dd39db47c5e9717995df4cf114983b7ed19c352;hb=d7875c296a4988e9f27e2776237884deb1984c62;hp=4b318df26e6960e59e5f9d8dbe13c793d52f130a;hpb=2cf0f474c780f5194b373f631bfa8d447114385b;p=sbcl.git diff --git a/tests/lambda-list.pure.lisp b/tests/lambda-list.pure.lisp index 4b318df..3dd39db 100644 --- a/tests/lambda-list.pure.lisp +++ b/tests/lambda-list.pure.lisp @@ -6,23 +6,34 @@ ;;;; While most of SBCL is derived from the CMU CL system, the test ;;;; files (like this one) were written from scratch after the fork ;;;; from CMU CL. -;;;; +;;;; ;;;; This software is in the public domain and is provided with ;;;; absolutely no warranty. See the COPYING and CREDITS files for ;;;; more information. -(let ((*macroexpand-hook* (lambda (fun form env) - (handler-bind ((error (lambda (c) - (when (eq 'destructuring-bind (car form)) - (throw 'd-b-error c))))) - (funcall fun form env))))) - (macrolet ((error-p (ll) +(let ((*macroexpand-hook* + (compile nil + (lambda (fun form env) + (handler-bind ((error (lambda (c) + (when (eq 'destructuring-bind (car form)) + (throw 'd-b-error c))))) + (funcall fun form env)))))) + (macrolet ((maybe-funcall (&rest args) + ;; The evaluator will delay lambda-list checks until + ;; the lambda is actually called. + (if (eq sb-ext:*evaluator-mode* :interpret) + `(funcall ,@args) + `(progn ,@args))) + (error-p (ll) `(progn - (multiple-value-bind (result error) (ignore-errors (eval `(lambda ,',ll 'ok))) + (multiple-value-bind (result error) + (ignore-errors (maybe-funcall (eval `(lambda ,',ll 'ok)))) (unless (and (not result) error) (error "No error from lambda ~S." ',ll))) (catch 'd-b-error - (eval `(lambda (x) (destructuring-bind ,',ll x 'ok))) + (maybe-funcall + (eval `(lambda (x) (destructuring-bind ,',ll x 'ok))) + nil) (error "No error from d-b ~S." ',ll))))) (error-p (&aux (foo 1) &aux (bar 2))) (error-p (&aux (foo 1) &key bar))