On Fri, Jul 05, 2019 at 09:13:36AM +0300, megane wrote:
> I reduced this case to this:
> 
>   (define (foo bindings)
>     (define (append-map proc lst1)
>       (if lst1
>           (proc 1)
>           (proc 1 2)))
>     (append-map (lambda (b a) (begin)) bindings))
> 
> Error: ../fail.scm:5: proc: procedure `proc' called with wrong number of
> arguments

Wow, my mind is blown.  Great job at finding this!  This seems to be
exactly what is happening inside the compiler after removing the
(not captured) test, but like you show here it doesn't have anything
to do with that test, it can be triggered separately too.

I created a ticket for it: https://bugs.call-cc.org/ticket/1630

> This seems to be a separate optimizer issue as it triggers with 5.1.0rc1
> and 4.13.0 too.

I think you're right, this has nothing to do with the patch.  We'll need
to fix this bug first, I think, and then we can try again with removing
the (not captured) check.

Cheers,
Peter

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to