- changed status to resolved
vector-map should be run in the same dynamic environment when multiple return occurs
Issue #77
resolved
This test should be pass.
(let ([only-once #t]
[v0 (vector 1 2 3 4 5 6)]
[cl '()]
[old-v1 #f])
(let ([v1 (vector-map
(lambda (e)
(call/cc
(lambda (c)
(set! cl (cons c cl))
(* e e))))
v0)])
(when only-once
(set! only-once #f)
(set! old-v1 v1)
((car (reverse cl)) 'x))
(test-equal '#(1 2 3 4 5 6) v0)
(test-equal '#(1 4 9 16 25 36) old-v1)
(test-equal '#(x 4 9 16 25 36) v1)))
Found on Mosh repository: https://github.com/okuoku/mosh/commit/80664a98bd1cf9e699b691f92d270ebaa9b9e83b
Comments (1)
-
reporter - Log in to comment
Modified vector-map not to allocate return vector first. (Fixes
#77) It now always allocates a returning vector at the end of process.→ <<cset 8bd2937cc641>>