Summary

expand* and ppexpand* break on the "and" macro

Metadata

Description

Hi,

I have tried sending the definition of "and" from R5RS,

 (define-syntax my-and
   (syntax-rules ()
     ((my-and) #t)
     ((my-and test) test)
     ((my-and test1 test2 ...)
      (if test1 (my-and test2 ...) #f))))

to expand* and ppexpand*, and they break:

 #;2> (ppexpand* '(my-and 1 2 3))
 
 Error: (null-list?) bad argument type - not a list: 3
 
 	Call history:
 
 	<eval>		(rename22 (##core#syntax my-and))
 	<eval>		(##sys#cons (quote21 #f) (quote21 ()))
 	<eval>		(##sys#cdr input13)
 	<eval>		(##sys#eq? tail23 (quote ()))
 	<eval>		(##sys#pair? temp24)
 	<eval>		(##sys#eq? (##sys#cdr temp24) (quote ()))
 	<eval>		(##sys#cdr temp24)
 	<eval>		(##sys#car tail23)	<--

But the macro works fine:

 #;3> (my-and 1 2 3)
 3
 #;4> (my-and 2 #f 4)
 #f

But it works with other macros I have been using.

I'm using git Chicken master/HEAD, and expand-full 1.0.0.

J.

Changes and comments

[2010-04-23 14:46:18 UTC] felix removed milestone 4.5.0

[2010-07-22 01:16:35 UTC] jeronimo wrote:

Looks like this has been fixed by in svn! :-)

Thanks Kon!

[2010-08-09 22:04:36 UTC] kon changed status from new to closed

[2010-08-09 22:04:36 UTC] kon set resolution to fixed