bugKawa - Bugs: bug #35533, Unhygienic expansion

 
 

bug #35533: Unhygienic expansion

Submitter:  Helmut Eller <ellerh>
Submitted:  Wed 15 Feb 2012 11:59:45 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Postponed
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 19 Apr 2012 06:09:19 AM UTC, comment #1: 

Hm.  This one may be difficult to fix.
Worth another look after 1.12 is out.

Per Bothner <bothner>
Group administrator
Wed 15 Feb 2012 11:59:45 AM UTC, original submission:  

Unhygienic expansion

In this example def-foo is no expanded correctly.  foo-aux should be a
fresh identifier for each use of def-foo.

(define-syntax def-foo
  (syntax-rules ()
    ((def-foo name)
     (begin
       (define (foo-aux obj)
         (eq? obj 'name))
       (define (name obj)
         (foo-aux obj))))))

(def-foo bar)
(def-foo baz)

(when (or (not (bar 'bar))
          (not (baz 'baz))
          (bar 'baz)
          (baz 'bar))
  (error "bug"))


This is the output of the compiler:

shell> kawa --version -C y.scm
Kawa 1.12 (revision 7169M)
Copyright (C) 2011 Per Bothner
(compiling y.scm)
y.scm:10:16: duplicate declaration of 'foo-aux'
y.scm:10:16: (this is the previous declaration of 'foo-aux')
[Exit 1]


Helmut Eller <ellerh>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bothner (Posted a comment)
  • -email is unavailable- added by ellerh (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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-04-19 bothner StatusNone Postponed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code