jscl icon indicating copy to clipboard operation
jscl copied to clipboard

Macro lambda lists aren't parsed quite right in general

Open brpocock opened this issue 9 years ago • 3 comments

Test example:

 (defmacro x (y &optional (&rest z))     `(print ,y))
 (x y)

Signals an error that Z is unbound.

This particularly affects definition of ASSERT, although I have a simplified ASSERT that can be used without the var-list and message optional args.

brpocock avatar Aug 10 '16 06:08 brpocock

Not all lambda expressions are implemented, just the ordinary lambda-expressions, and probably is not even complete.

That means we should improve https://github.com/jscl-project/jscl/blob/master/src/lambda-list.lisp to support other lambda-lists.

Full list:

http://www.lispworks.com/documentation/lw60/CLHS/Body/03_d.htm

davazp avatar Aug 11 '16 15:08 davazp

Just to note, I seem to think the "presentp" third part of regular &optional is probably also not working correctly.

On Thu, Aug 11, 2016, 11:22 David Vázquez Púa [email protected] wrote:

Not all lambda expressions are implemented, just the ordinary lambda-expressions, and probably is not even complete.

That means we should improve https://github.com/jscl-project/jscl/blob/master/src/lambda-list.lisp to support other lambda-lists.

Full list:

http://www.lispworks.com/documentation/lw60/CLHS/Body/03_d.htm

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jscl-project/jscl/issues/243#issuecomment-239194865, or mute the thread https://github.com/notifications/unsubscribe-auth/AB-HO5XyIN6OQQOH_ZdTU9xJzcb1iZTNks5qez5IgaJpZM4JgzKm .

brpocock avatar Aug 11 '16 16:08 brpocock

That is a bug. I have fixed it now.

The whole lambda compilation is pretty messy. There is also redundant logic with lambda-list.lisp. It needs some work.

davazp avatar Aug 11 '16 16:08 davazp