okuoku / yuni

R7RS/R6RS/Generic Scheme portability platform
Other
32 stars 3 forks source link

MIT/GNU Scheme, Cyclone: Does not follow dynamic scoping rule #153

Closed okuoku closed 2 years ago

okuoku commented 4 years ago

SRFI-34 and R7RS says:

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

but MIT/GNU Scheme evaluates cond clauses inside body's dynamic environment, which is incorrect. Guile2 also affected but it is fixed in Guile3.

(define p0 (make-parameter 0))

(check-equal 'done4
             (parameterize
               ((p0 1))
               (check-equal 1 (p0))
               (guard
                 (cnd (#t
                       (check-equal 1 (p0)) ;; Guile2 and MIT/GNU Scheme says 2 here
                       'done4))
                 (check-equal 1 (p0))
                 (parameterize
                   ((p0 2))
                   (check-equal 2 (p0))
                   (raise 'bogus)))))
okuoku commented 2 years ago

Filed:

https://github.com/justinethier/cyclone/issues/491

Tracked in exp2.