(let ((k (cal-with-prompt tag (-- expr that ends with (values a b c) --) (-- expr that is of unknown values length --))))
So it looks like peval.scm in language/tree-il does not handle this well.
(($ <prompt> src tag body handler)
(define (make-prompt-tag? x)
(match x
(($ <application> _ ($ <primitive-ref> _ 'make-prompt-tag)
(or () ((? constant-expression?))))
#t)
(_ #f)))
(let ((tag (for-value tag))
(body (for-tail body)))
... cases where we can optimize sue to knowledge of prompt-tag ...
(else
(make-prompt src tag body (for-value handler))))))
So to me it looks like peval does a for-tail on body, and uses the value constraint on the body. I'm not sure how to fix this though.
But that this is the problem can be shown by changing the code to
(($ <prompt> src tag body-in handler)
(define (make-prompt-tag? x)
(match x
(($ <application> _ ($ <primitive-ref> _ 'make-prompt-tag)
(or () ((? constant-expression?))))
#t)
(_ #f)))
(let ((tag (for-value tag))
(body (for-tail body-in)))
... cases where we can optimize sue to knowledge of prompt-tag ...
(else
(make-prompt src tag (for-values body-in) (for-value handler))))))
/Stefan