(let-optional-template, let-keywords-template): Change
authorKevin Ryde <user42@zip.com.au>
Sat, 25 Sep 2004 22:06:01 +0000 (22:06 +0000)
committerKevin Ryde <user42@zip.com.au>
Sat, 25 Sep 2004 22:06:01 +0000 (22:06 +0000)
"(begin body)" to "(let () body)" for empty bindings, since the former
allows "internal defines" in body leak out to the surrounding
environment.

ice-9/optargs.scm

index 5702841..9666809 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; optargs.scm -- support for optional arguments
 ;;;;
-;;;;   Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+;;;;   Copyright (C) 1997, 1998, 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
 
 (define (let-optional-template REST-ARG BINDINGS BODY let-type)
     (if (null? BINDINGS)
-       `(begin ,@BODY)
+       `(let () ,@BODY)
        (let-o-k-template REST-ARG BINDINGS BODY let-type
                          (lambda (optional)
                            `(,(car optional)
 
 (define (let-keywords-template REST-ARG ALLOW-OTHER-KEYS? BINDINGS BODY let-type)
     (if (null? BINDINGS)
-       `(begin ,@BODY)
+       `(let () ,@BODY)
        (let* ((kb-list-gensym (gensym "kb:G"))
               (bindfilter (lambda (key)
                             `(,(car key)