On Thu, Jul 02, 2009 at 03:03:09PM +0200, felix winkelmann wrote:
> Hi!
> 
> The release candidate for 4.1.0 is available now at
> 
> http://www.call-with-current-continuation.org/chicken-4.1.0rc1.tar.gz
> 
> If you have a few minutes, download it and give it a try.

Whew!  Found another tricky bug.  It appears that when you have an
extended lambda list (with DSSSL syntax) inside a module, the names
in the non-extended part of the argument list are renamed in the syntax
environment instead of the expansion environment.

Attached is a patch with regression test to fix this.  I hope this can
be included in 4.1.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth
Index: tests/module-tests.scm
===================================================================
--- tests/module-tests.scm      (revision 15157)
+++ tests/module-tests.scm      (working copy)
@@ -145,4 +145,15 @@
              (begin0 1 2 3))
            1)
 
+(module m14 (test-extlambda)
+  (import chicken scheme)
+  (define (test-extlambda string #!optional whatever)
+    string))
+
+(import m14)
+
+(test-equal "extended lambda list uses expansion environment"
+            "some text"
+            (test-extlambda "some text"))
+
 (test-end "modules")
Index: expand.scm
===================================================================
--- expand.scm  (revision 15157)
+++ expand.scm  (working copy)
@@ -484,18 +484,18 @@
                          (loop 3 req opt '() r)
                          (err "`#!key' argument marker in wrong context") ) ]
                     [else
-                     (cond [(symbol? x)
+                     (cond [(symbol? var)
                             (case mode
-                              [(0) (loop 0 (cons x req) '() '() r)]
-                              [(1) (loop 1 req (cons (list x #f) opt) '() r)]
+                              [(0) (loop 0 (cons var req) '() '() r)]
+                              [(1) (loop 1 req (cons (list var #f) opt) '() r)]
                               [(2) (err "invalid lambda list syntax after 
`#!rest' marker")]
-                              [else (loop 3 req opt (cons (list x) key) r)] ) ]
-                           [(and (list? x) (eq? 2 (length x)))
+                              [else (loop 3 req opt (cons (list var) key) r)] 
) ]
+                           [(and (list? var) (eq? 2 (length var)))
                             (case mode
                               [(0) (err "invalid required argument syntax")]
-                              [(1) (loop 1 req (cons x opt) '() r)]
+                              [(1) (loop 1 req (cons var opt) '() r)]
                               [(2) (err "invalid lambda list syntax after 
`#!rest' marker")]
-                              [else (loop 3 req opt (cons x key) r)] ) ]
+                              [else (loop 3 req opt (cons var key) r)] ) ]
                            [else (err "invalid lambda list syntax")] ) ] ) ) ] 
) ) ) ) ) )
 
 

Attachment: pgpouwAWHi5Q5.pgp
Description: PGP signature

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to