From: Nikodemus S. <de...@us...> - 2006-08-11 08:08:50
|
Update of /cvsroot/sbcl/sbcl/tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25530/tests Modified Files: compiler.impure.lisp Log Message: 0.9.15.26: compiler-macro lambda-list parsing and FUNCALL forms * We previously handled only the &WHOLE case, and also failed to handle the argument count checking correct. Now things should work, but FUNCALL forms are not still subject to compiler-macroexpansion -- yet. (Reported by James Y Knight) * Refactor the macro-lambda-list parsing code slightly for easier comprehension. Index: compiler.impure.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/tests/compiler.impure.lisp,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- compiler.impure.lisp 5 Aug 2006 10:56:59 -0000 1.69 +++ compiler.impure.lisp 11 Aug 2006 08:08:39 -0000 1.70 @@ -1262,4 +1262,21 @@ (type-error (c) (assert (eq (type-error-expected-type c) 'integer))) (:no-error (&rest vals) (error "no error")))) +;;; FUNCALL forms in compiler macros +(define-compiler-macro test-cmacro-1 + (&whole whole a &optional b &rest c &key d) + (list whole a b c d)) + +(macrolet ((test (form a b c d) + `(let ((form ',form)) + (destructuring-bind (whole a b c d) + (funcall (compiler-macro-function 'test-cmacro-1) form nil) + (assert (equal whole form)) + (assert (eql a ,a)) + (assert (eql b ,b)) + (assert (equal c ,c)) + (assert (eql d ,d))))) ) + (test (funcall 'test-cmacro-1 1 2 :d 3) 1 2 '(:d 3) 3) + (test (test-cmacro-1 11 12 :d 13) 11 12 '(:d 13) 13)) + ;;; success |