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

guard's cond clauses evalued in unexpected dynamic environment #491

Open
okuoku opened this issue Jul 24, 2022 · 1 comment
Open

guard's cond clauses evalued in unexpected dynamic environment #491

okuoku opened this issue Jul 24, 2022 · 1 comment

Comments

@okuoku
Copy link

okuoku commented Jul 24, 2022

tested: cf66cf1

It seems guard syntax evaluates its cond clause s in wrong dynamic environment. e.g.)

(define p0 (make-parameter 1))
(guard
  (c (#t
      (display (list (p0) '== 1)) (newline)))
  (parameterize ((p0 2))
                (display (list (p0) '== 2)) (newline)
                (raise 'unused)))

should print

(2 == 2)
(1 == 1)

but it prints

(2 == 2)
(2 == 1)

R7RS specifies dynamic environment here as:

That implicit cond expression is evaluated with the continuation and dynamic environment of the guard expression.

@justinethier
Copy link
Owner

Thanks for the report @okuoku, I'll look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants