emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#14039: closed (Bug in with-fluids semantics)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#14039: closed (Bug in with-fluids semantics)
Date: Sat, 23 Mar 2013 19:10:02 +0000

Your message dated Sat, 23 Mar 2013 20:07:31 +0100
with message-id <address@hidden>
and subject line Re: bug#14039: Bug in with-fluids semantics
has caused the debbugs.gnu.org bug report #14039,
regarding Bug in with-fluids semantics
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
14039: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14039
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Bug in with-fluids semantics Date: Sat, 23 Mar 2013 11:41:29 +0100 User-agent: KMail/4.9.5 (Linux/3.5.0-26-generic; KDE/4.9.5; x86_64; ; )
Consider this simple exmple with fluids and reodos via propmts,

(define (f x) 
  (let ((s (make-fluid 0))) 
     (with-fluids ((s 0)) 
        (let lp ((i 0)) 
           (cond ((>= i 100) (fluid-ref s)) 
                 ((= i 50) (abort-to-prompt 'tag) (lp (+ i 1))) 
                 (else (fluid-set! s (+ (fluid-ref s) i)) 
                       (lp (+ i 1))))))))

(define k (call-with-prompt 'tag (lambda () (f 1)) (lambda (k . l)
k)))

Then we will get in guile-2.0 pretty resent git version
scheme@(guile-user)> (k)
$1 = 4900
scheme@(guile-user)> (k)
$2 = 8575

The reason is that when the with-fluid returns normally it does a full
swap. It should only do half a swap e.g. restore the old value of the
fluid and not store the current which is of non use because it can not
be reached anymore and it contaminates the continuation k.

/Stefan




--- End Message ---
--- Begin Message --- Subject: Re: bug#14039: Bug in with-fluids semantics Date: Sat, 23 Mar 2013 20:07:31 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)
On Sat 23 Mar 2013 11:41, Stefan Israelsson Tampe <address@hidden> writes:

> The reason is that when the with-fluid returns normally it does a full
> swap. It should only do half a swap e.g. restore the old value of the
> fluid and not store the current which is of non use because it can not
> be reached anymore and it contaminates the continuation k.

That's not how fluids work, semantically: for better (I think) or for
worse (you think).  We cannot change this.

A
-- 
http://wingolog.org/


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]