* bug#9844: peval & dynamic-wind
@ 2011-10-23 11:48 Ian Price
2011-11-09 15:58 ` Andy Wingo
0 siblings, 1 reply; 3+ messages in thread
From: Ian Price @ 2011-10-23 11:48 UTC (permalink / raw)
To: 9844
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"
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#9844: peval & dynamic-wind
2011-10-23 11:48 bug#9844: peval & dynamic-wind Ian Price
@ 2011-11-09 15:58 ` Andy Wingo
2011-11-09 19:17 ` Ian Price
0 siblings, 1 reply; 3+ messages in thread
From: Andy Wingo @ 2011-11-09 15:58 UTC (permalink / raw)
To: Ian Price; +Cc: 9844-done
On Sun 23 Oct 2011 13:48, Ian Price <ianprice90@googlemail.com> 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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#9844: peval & dynamic-wind
2011-11-09 15:58 ` Andy Wingo
@ 2011-11-09 19:17 ` Ian Price
0 siblings, 0 replies; 3+ messages in thread
From: Ian Price @ 2011-11-09 19:17 UTC (permalink / raw)
To: 9844
> Sorry it's taken so long, but this is fixed now in stable-2.0
Yes, this works fine for me. Much appreciated.
--
Ian Price
"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-09 19:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-23 11:48 bug#9844: peval & dynamic-wind Ian Price
2011-11-09 15:58 ` Andy Wingo
2011-11-09 19:17 ` Ian Price
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).