bugKawa - Bugs: bug #21316, Wrong binding within syntax-rules...

 
 

bug #21316: Wrong binding within syntax-rules when actual parameter name matches formal

Submitted by:  Mark Rose <markrose>
Submitted on:  Wed 10 Oct 2007 03:30:23 PM UTC  
 
Category: Scheme languageSeverity: 3 - Normal
Item Group: Unexpected resultStatus: 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.

 

Wed 10 Oct 2007 03:50:36 PM UTC, comment #1:

Added the Scheme snippets as files: petrofsky-1a.scm is the original from Petrofsky, which doesn't work. petrofsky-1b.scm has all bindings renamed, and works correctly in Kawa.

I have tried the example in SISC 1.16.6, where it appears to give the correct answer.

Mark Rose <markrose>
Wed 10 Oct 2007 03:30:23 PM UTC, original submission:

One of Al Petrofsky's macro definition test cases, from http://petrofsky.org/src/primer.txt:

(let ((x 1))
(let-syntax
((foo (syntax-rules ()
((_ y) (let-syntax
((bar (syntax-rules ()
((_ x) y))))
(bar 2))))))
(foo x)))

Kawa 1.9.2 gives an answer of "2". However, renaming all the bindings to unique values (which should make no difference), changes the answer to the correct "1":

(let ((x_1 1))
(let-syntax
((foo_2 (syntax-rules ()
((_ y_3) (let-syntax
((bar_4 (syntax-rules ()
((_ x_5) y_3))))
(bar_4 2))))))
(foo_2 x_1)))

Mark Rose <markrose>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #14127:  petrofsky-1b.scm added by markrose (267B - application/octet-stream)
file #14126:  petrofsky-1a.scm added by markrose (233B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by markrose (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 10 Oct 2007 03:33:21 PM UTCmarkroseAttached File-=>Added petrofsky-1a.scm, #14126
      Attached File-=>Added petrofsky-1b.scm, #14127

    Back to the top


    Powered by Savane 3.1-cleanup