GNU bug report logs - #18356
Should partial continuations capture the dynamic environment?

Previous Next

Package: guile;

Reported by: Taylan Ulrich Bayirli/Kammer <taylanbayirli <at> gmail.com>

Date: Fri, 29 Aug 2014 18:13:02 UTC

Severity: normal

Tags: notabug

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Taylan Ulrich Bayirli/Kammer <taylanbayirli <at> gmail.com>
To: 18356 <at> debbugs.gnu.org
Subject: bug#18356: Should partial continuations capture the dynamic environment?
Date: Fri, 29 Aug 2014 20:26:47 +0200
Some more examples; this one works fine:

scheme@(guile-user)> (define (with-captured-dynenv proc)
                       (let ((tag (make-prompt-tag "dynenv-capture")))
                         (call-with-prompt
                          tag
                          (lambda ()
                            (proc (lambda (thunk)
                                    (abort-to-prompt tag thunk))))
                          (lambda (return thunk)
                            (return (thunk))))))
scheme@(guile-user)> (define param (make-parameter 0))
scheme@(guile-user)> (parameterize ((param 1))
                       (with-captured-dynenv
                        (lambda (dynenv)
                          (parameterize ((param 2))
                            (dynenv (lambda () (param)))))))
$2 = 1

But not this simpler one:

scheme@(guile-user)> (define (with-captured-dynenv proc)
                       (let ((tag (make-prompt-tag "dynenv-capture")))
                         (call-with-prompt
                          tag
                          (lambda ()
                            ((abort-to-prompt tag)))
                          (lambda (call-in-captured-dynenv)
                            (proc call-in-captured-dynenv)))))
scheme@(guile-user)> (parameterize ((param 1))
                       (with-captured-dynenv
                        (lambda (dynenv)
                          (parameterize ((param 2))
                            (dynenv (lambda () (param)))))))
$3 = 2

Taylan




This bug report was last modified 10 years and 307 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.