Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore (debug-level 2) behavior, but reduce its guarantees #834

Merged
merged 1 commit into from
May 25, 2024

Commits on May 21, 2024

  1. restore (debug-level 2) behavior, but reduce its guarantees

    When `debug-level` is 2 or more, optimization is supposed to refrain
    from moving a call to an error function into tail position of the
    enclosing function. (That's a stronger guarantee than the usual one of
    not moving an expression into tail position if there's potentially a
    way to detect the movement through continuation marks.) An earlier
    commit 6a73b9e strengthened movement of error calls in a way that
    did not preserve this `(debug-level 2)` constraint, so this commit
    primarily adjusts those changes. Also, the earlier commit 19af32e
    allowed the compiler to move an error call out of tail position, and
    that transformation is now suppressed when `debug-level` is 2 or more.
    
    These changes are meant to help with debugging, but they're not enough
    to implement the previously specified behavior of `debug-level`. It
    turns out that Chez Scheme v9.x didn't implement the specified
    behavior, either, because it would convert `(let ([x (error ...)]) x)`
    to just `(error ...)`, for example. The old specification seems too
    strong, and so part of the revision here is to change the specificaton
    to be encouraging a particular interaction of errors and
    continuaton-inspection results, but not guaranteeing it. Meanwhile,
    when well-defined reflection on continuations is needed, continuation
    marks provide that functionality.
    mflatt committed May 21, 2024
    Configuration menu
    Copy the full SHA
    d22d7e8 View commit details
    Browse the repository at this point in the history