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

 
 

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

Submitted by:  Steve Yegge <stevey>
Submitted on:  Sat 05 Feb 2005 04:18:39 PM UTC  
 
Category: Scheme languageSeverity: 3 - Normal
Item Group: Unexpected resultStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

This shoudl now be working.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 19 May 2005 04:55:01 PM UTCbothnerStatusPostponed=>Fixed
  Open/ClosedOpen=>Closed
Tue 12 Apr 2005 06:36:22 PM UTCbothnerStatusInvalid=>Postponed
Sat 12 Feb 2005 09:41:37 AM UTCbothnerStatusNone=>Invalid
  Assigned toNone=>bothner

Back to the top


Powered by Savane 3.1-cleanup1