bugKawa - Bugs: bug #10561, define-syntax and case generate...

 
 

bug #10561: define-syntax and case generate bad code

Submitted by:  Chris Dean <ctdean>
Submitted on:  Sun 03 Oct 2004 03:03:33 AM 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.

 

Tue 09 Nov 2004 01:01:54 AM UTC, comment #2:

This now works in CVS with the re-written hygiene framework.
I checked the testcase into the Kawa testsuite.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Mon 04 Oct 2004 10:16:46 PM UTC, comment #1:

I haven't chased this all they way, but I'm not too surprised. The interaction between quote handling and hygiene is a bit kludgy. The basic problem is that Kawa handles hygiene by symbol renaming, which conflicts with quote; the implemented solution is not very robust.

A better solution may be to implement hygiene using lexical closures. I suspect syntax-case uses some variant of the latter. I'd like to take some time out and clean up macro handling in Kawa, including solid let-syntax/letrec-syntax support, fixing quote handling, and useful (maybe complete) support for implementation. I'd prefer to defer this bug until then.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Sun 03 Oct 2004 03:03:33 AM UTC, original submission:

Both (foo) and (bar) below should return the same result, but
(foo) returns the wrong result due to improper macro expansion.

(define-syntax log-mode
(syntax-rules ()
((log-mode mode)
(case 'mode
((error) "error mode")
((warning) "warning mode")
(else "bad mode")))))

(define (foo)
(log-mode warning))

(define (bar)
(case 'warning
((error) "error mode")
((warning) "warning mode")
(else "bad mode")))

Chris Dean <ctdean>

 

(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 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 09 Nov 2004 01:01:54 AM UTCbothnerStatusPostponed=>Fixed
  Open/ClosedOpen=>Closed
Mon 04 Oct 2004 10:16:46 PM UTCbothnerStatusNone=>Postponed
  Assigned toNone=>bothner

Back to the top


Powered by Savane 3.1-cleanup1