I'm writing some unit tests for PS functions and want to be able to report the test expressions that fail. &whole is perfect for this. But it doesn't quite behave as expected.
In Lisp:
(defmacro lisp-blah (x y &whole w) w) (macroexpand-1 '(lisp-blah 10 20)) => (LISP-BLAH 10 20)
In Parenscript:
(defpsmacro ps-blah (x y &whole w) w) (ps::ps-macroexpand '(ps-blah 10 20)) => (10 20)
Also, if you do this:
(defmacro/ps blah (x y &whole w) w)
then the following expression hangs:
(ps::ps-macroexpand '(blah10 20))
Daniel
In Lisp:
(defmacro lisp-blah (x y &whole w) w) (macroexpand-1 '(lisp-blah 10 20)) => (LISP-BLAH 10 20)
That's not a feature, that's a bug in Allegro CL!
"If &whole and a following variable appear, they must appear first in lambda-list, before any other parameter"
Patch for correctly implementing top-level &whole in ParenScript macro lambda lists forthcoming.
Also, if you do this:
(defmacro/ps blah (x y &whole w) w)
then the following expression hangs:
(ps::ps-macroexpand '(blah 10 20))
Recursive macroexpansion! Try (defmacro foo (&whole x a b) x) (foo 1 2) and it should hang in Lisp too (it does in SBCL).
Happy hacking, Vladimir
Alright, support for &whole arguments in PS macro lambda lists is now in the darcs repository.
Happy hacking, Vladimir
On 9/13/07, Daniel Gackle danielgackle@gmail.com wrote:
I'm writing some unit tests for PS functions and want to be able to report the test expressions that fail. &whole is perfect for this. But it doesn't quite behave as expected.
In Lisp:
(defmacro lisp-blah (x y &whole w) w) (macroexpand-1 '(lisp-blah 10 20)) => (LISP-BLAH 10 20)
In Parenscript:
(defpsmacro ps-blah (x y &whole w) w) (ps::ps-macroexpand '(ps-blah 10 20)) => (10 20)
Also, if you do this:
(defmacro/ps blah (x y &whole w) w)
then the following expression hangs:
(ps::ps-macroexpand '(blah10 20))
Daniel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel@common-lisp.net