1 ;;;; lambda-list parsing tests with no side-effects
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
14 (macrolet ((error-p (ll)
16 (multiple-value-bind (result error) (ignore-errors (handler-bind ((error #'error))
17 (eval `(lambda ,',ll 'ok))))
18 (unless (and (not result) error)
19 (error "No error from lambda ~S." ',ll)))
20 (multiple-value-bind (result error) (ignore-errors (handler-bind ((error #'error))
21 (eval `(lambda (x) (destructuring-bind ,',ll x 'ok)))))
22 (unless (and (not result) error)
23 (error "No error from d-b ~S." ',ll))))))
24 (error-p (&aux (foo 1) &aux (bar 2)))
25 (error-p (&aux (foo 1) &key bar))
26 (error-p (&aux (foo 1) &optional bar))
27 (error-p (&aux (foo 1) &rest bar))
28 (error-p (&key foo &allow-other-keys &allow-other-keys))
29 (error-p (&key foo &key bar))
30 (error-p (&key foo &optional bar))
31 (error-p (&key foo &rest bar))
32 (error-p (&optional foo &optional bar))
33 (error-p (&rest foo &rest bar))
34 (error-p (&rest foo &optional bar)))