Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#277 closed defect (fixed)

keywords should not be renamed by syntax expansion

Reported by: felix winkelmann Owned by: felix winkelmann
Priority: critical Milestone:
Component: expander Version: 4.5.x
Keywords: keywords Cc: sjamaan
Estimated difficulty:

Description

(Example by sjamaan)

(define-syntax foo
  (syntax-rules ()
    ((foo procname)
     (define (procname #!key (who "world"))
       (print "hello, " who)))))

(foo bar)

(bar who: 1)

expands into:

(set! bar
  (##core#lambda
    tmp3839
    (let ((who3040
            (##sys#get-keyword 'who30: tmp3839 (##core#lambda () '"world"))))
      (let () (print '"hello, " who3040)))))

and doesn't detect the "who:" keyword correctly on invocation.
Note that the who variable must be renamed, the keyword not.

Change History (3)

comment:1 Changed 15 years ago by felix winkelmann

Resolution: fixed
Status: newclosed

Fixed in 3095a8700d0bda4c6a145c70ca5ae1ced6023389 (master).

comment:2 Changed 15 years ago by sjamaan

Great, thanks Felix!

comment:3 Changed 14 years ago by felix winkelmann

Milestone: 4.6.0

Milestone 4.6.0 deleted

Note: See TracTickets for help on using tickets.