bugKawa - Bugs: bug #11859, fluid-let misbehaves in...

 
 

bug #11859: fluid-let misbehaves in upward-only continuation

Submitter:  Steve Yegge <stevey>
Submitted:  Sat 05 Feb 2005 04:18:39 PM UTC
   
 
Category:  Scheme language Severity:  3 - Normal
Item Group:  Unexpected result Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 19 May 2005 04:55:01 PM UTC, comment #3: 

This shoudl now be working.

Per Bothner <bothner>
Group administrator
Tue 12 Apr 2005 06:36:22 PM UTC, comment #2: 

There actually is a reasonable way to handle lexical definitions:
If the compiler sees a fluid-let that rebinds a lexically defined VAR:
(let ((VAR INIT))
  ... VAR ...
  (set! VAR ...)
  (fluid-let ((VAR VAL))
     ... VAR ...)))
it rewrites to use a ThreadLocation.  Expressed using SRFI-39 parameter objects, this would be:
(let ((VARP (make-parameter INIT)))
  ... (VARP) ...
  (VARP ...)
  (parameterize ((VARP VALUE))
     ... (VARP) ...)))
This isn't much different from the rewrite done when seeing a (location VAR).

Per Bothner <bothner>
Group administrator
Sat 12 Feb 2005 09:41:37 AM UTC, comment #1: 

I don't buy this.  I think Dybvig and I have different concepts of fluid-let.  In Kawa fluid-let modifies the dynamic environment.  The function f accesses the lexically defined x, bound to 'a.  The fluid-let modifies the global x.
Dybvig's fluid-let is a macro that saves and restores whatever variables is in the macro-time scope, so the code happens to work.  But what happens if yo have multiple threads?  Especially tricky i what happens in threads inherit bindings, as they do in Kawa.
I'm not saying we couldn't make the test-case well-defined. However, I don't know how to do that and still have the behavior Kawa supports for nested threads (futures).

Per Bothner <bothner>
Group administrator
Sat 05 Feb 2005 04:18:39 PM UTC, original submission:  

On page 106 of Dyvbig's 3rd edition TSPL
(also online at http://www.scheme.com/tspl3/control.html#./control:h5),
this example:

(let ((x 'a))
  (let ((f (lambda () x)))
    (cons (call/cc
            (lambda (k)
              (fluid-let ((x 'b))
                (k (f)))))
          (f))))

should return (b . a), but Kawa returns (a . a).

Steve Yegge <stevey>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-05-19 bothner StatusPostponed Fixed
    Open/ClosedOpen Closed
2005-04-12 bothner StatusInvalid Postponed
2005-02-12 bothner StatusNone Invalid
    Assigned toNone bothner

Back to the top

Powered by Savane 3.13-bb6a.
Corresponding source code