> Not a known bug, no. Can you make a test case?

Yes, attached. It appears to happen when (rnrs control) is used. This
is with the latest master commit.

> No, it will not. The primitive-ref return thing is a hack; the proper
> way to do this (I think?) is to use prompts and aborts, and also enhance
> Guile's compiler to do source-to-source translation of Tree-IL in which
> an intraprocedural abort to a prompt with a fresh tag that cannot escape
> the prompt expression does some kind of CPS on the expression to leave
> the return expression in tail context.
>
> Otherwise we could add `return' to Tree-IL, but that is nasty I think;
> or another hack (nasty, but perhaps expedient). Better to CPS, in the
> long run anyway.

It's not urgent, but Lua does mandate tail call optimization.

On a related note, what would be the best way to benchmark a compiler
optimization? I see "benchmark-guile"; is there a way to easily run it
with an optimization enabled and disabled?  And maybe get some fancy
charts and graphs, too?

Attachment: test.scm
Description: Binary data

Reply via email to