Summary

keywords should not be renamed by syntax expansion

Metadata

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.

Changes and comments

[2010-06-30 09:26:21 UTC] felix changed status from new to closed

[2010-06-30 09:26:21 UTC] felix set resolution to fixed

[2010-06-30 09:26:21 UTC] felix wrote:

Fixed in 3095a8700d0bda4c6a145c70ca5ae1ced6023389 (master).

[2010-06-30 09:29:12 UTC] sjamaan wrote:

Great, thanks Felix!

[2011-04-04 08:31:00 UTC] felix removed milestone 4.6.0

[2011-04-04 08:31:00 UTC] felix wrote:

Milestone 4.6.0 deleted