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

 
 

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

Submitter:  Mark Rose <markrose>
Submitted:  Wed 10 Oct 2007 03:30:23 PM UTC
   
 
Category:  Scheme language Severity:  3 - Normal
Item Group:  Unexpected result Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

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 Files:
   
   
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
  • -email is unavailable- added by markrose (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-10-10 markrose Attached File- Added petrofsky-1a.scm, #14126
        Attached File- Added petrofsky-1b.scm, #14127

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code