--- Begin Message ---
Subject: |
peval & dynamic-wind |
Date: |
Sun, 23 Oct 2011 12:48:43 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
I'm getting incorrect results in v2.0.3 when combining
dynamic-wind+call/cc with partial evaluation. In the program below, the
before-thunk is supposed to protect against reentry into the
body-thunk. However, with partial-evaluation turned on it doesn't error.
(define (test peval?)
(compile
'(let ()
(define (rewind-protect thunk protector)
(dynamic-wind
(let ((entered? #f))
(lambda ()
(if entered?
(error "Re-entering rewind-protected extent."))
(set! entered? #t)))
thunk
protector))
((call/cc
(lambda (k)
(rewind-protect
(lambda ()
(call/cc k)
(lambda _ 'not-supposed-to-happen))
(lambda () #f))))
#f))
#:opts `(#:partial-eval? ,peval?)))
;; scheme@(guile−user)> (test #t)
;; $1 = not−supposed−to−happen
;; scheme@(guile−user)> (test #f)
;; ERROR: In procedure scm−error:
;; ERROR: Re−entering rewind−protected extent.
;; Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
;; scheme@(#{ g256}#) [1]> ,q
;; scheme@(guile−user)>
If I place a (format #t "entered? ~s~%" entered?) before the (set!
entered? #t), I see
entered? #f
entered? #f
$2 = not−supposed−to−happen
which tells me that the earlier mutation isn't effecting later continuations.
--
Ian Price
"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#9844: peval & dynamic-wind |
Date: |
Wed, 09 Nov 2011 16:58:45 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
On Sun 23 Oct 2011 13:48, Ian Price <address@hidden> writes:
> I'm getting incorrect results in v2.0.3 when combining
> dynamic-wind+call/cc with partial evaluation.
Sorry it's taken so long, but this is fixed now in stable-2.0
Thanks for the report,
Andy
--
http://wingolog.org/
--- End Message ---