bugKawa - Bugs: bug #40616, Unhygienic syntax-rules

 
 

bug #40616: Unhygienic syntax-rules

Submitted by:  John Tobey <jtobey>
Submitted on:  Mon 18 Nov 2013 01:29:31 AM UTC  
 
Category: Scheme librarySeverity: 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 19 Nov 2013 12:47:10 AM UTC, comment #3:

That's a different problem. Again, I was afraid this might require major changes, but it turned out to be a clean and simple fix.

Thanks for the testcase. It and the fix are checked in.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Mon 18 Nov 2013 11:37:49 PM UTC, comment #2:

Thanks for the speedy fix. Still, this gives me a duplicate declaration error where I would expect it to succeed:

John Tobey <jtobey>
Mon 18 Nov 2013 09:18:55 PM UTC, comment #1:

At first glance, I was afraid this would require major changes to fix. However, it looks like a fairly modest and "local" bug in a single function.

When we create a definition in a macro, the "scope" (ScopeExp) object used is somewhat schizophrenic: the "real" scope used for optimization and code generation vs the "name lookup" scope used during macro expansion and name resolution. The latter is a special temporary TemplateScope created when expanding a syntax template. We need to set up some special monkeying around in that we create a special "alias declaration", so we can adjust it for the real scopes for later compilation stages.

The logic for this worked when passing in an explicit TemplateScope (via the nameSyntax parameter), but not when doing so implicitly - i.e. we had previously set the current scope to a TemplateScope.

The fix is checked in, along with your testcase. Thanks for the clean testcase, and I'm embarrassed a simple bug like that lasted so long.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Mon 18 Nov 2013 01:29:31 AM UTC, original submission:

This program outputs "correct" in Racket, Guile, and RnRS [1] but "wrong" in Kawa.

[1] e.g., R6RS Section 9.2: "If a macro transformer inserts a binding for an identifier (variable or keyword) not appearing in the macro use, the identifier is in effect renamed throughout its scope to avoid conflicts with other identifiers."

John Tobey <jtobey>

 

(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

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  • -unavailable- added by jtobey (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 the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 18 Nov 2013 09:18:55 PM UTCbothnerAssigned toNone=>bothner
      Open/ClosedOpen=>Closed
    Mon 18 Nov 2013 09:18:54 PM UTCbothnerStatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1