bugKawa - Bugs: bug #27042, Bad interaction between...

 
 
Show feedback again

bug #27042: Bad interaction between syntax-rules and call-with-values

Submitted by:  Helmut Eller <ellerh>
Submitted on:  Thu 16 Jul 2009 05:53:09 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Thu 16 Jul 2009 05:53:09 PM UTC, original submission:

This example

(let-syntax ((dlet
(syntax-rules ()
((dlet (var val) body)
(let ((saved var))
(set! var val)
(call-with-values (lambda () body)
(lambda (result)
(set! var saved)
result)))))))
(let ((x 0))
(list x
(dlet (x (+ x 10))
x)
x)))

should return (0 10 0) but returns (0 10 10).
The intention of dlet is to temporarily rebind the variable.
Sorry, couldn't come up with a simpler expression.

If it helps: referencing var inside the second lambda, e.g. with
something like (set! var var), works around the problem.

Helmut Eller <ellerh>

 

(Note: upload size limit is set to 512 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

 

Carbon-Copy List
  • -unavailable- added by ellerh (Submitted the item)
  •  

    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 421 here (basic anti-spam test):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup