From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: Re: let-values, and-let* no variables Date: Tue, 07 Sep 2004 10:12:25 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87llfney3a.fsf@zip.com.au> References: <87isbea99y.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1094516015 10413 80.91.224.253 (7 Sep 2004 00:13:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Sep 2004 00:13:35 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Sep 07 02:13:28 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C4Tc0-0003IY-00 for ; Tue, 07 Sep 2004 02:13:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C4ThC-0002EC-Ky for guile-devel@m.gmane.org; Mon, 06 Sep 2004 20:18:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C4Th4-0002Dp-Dd for guile-devel@gnu.org; Mon, 06 Sep 2004 20:18:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C4Th2-0002Dd-QM for guile-devel@gnu.org; Mon, 06 Sep 2004 20:18:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C4Th2-0002DT-Oj for guile-devel@gnu.org; Mon, 06 Sep 2004 20:18:40 -0400 Original-Received: from [61.8.0.84] (helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C4TbI-0000PH-HH for guile-devel@gnu.org; Mon, 06 Sep 2004 20:12:45 -0400 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i870Ch4u013653; Tue, 7 Sep 2004 10:12:43 +1000 Original-Received: from localhost (ppp2D99.dyn.pacific.net.au [61.8.45.153]) by mailproxy1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i870CflY012262; Tue, 7 Sep 2004 10:12:42 +1000 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1C4Taz-0001rd-00; Tue, 07 Sep 2004 10:12:25 +1000 Original-To: Marius Vollmer Mail-Copies-To: never User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:4085 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:4085 --=-=-= Marius Vollmer writes: > > Uhh, intuitively I'd say that this is wrong behavior. One that's guile specific is let-optional and let-keywords, eg. (use-modules (ice-9 optargs)) (let () (let-keywords '() #f () (define localvar 123)) localvar) => 123 which could be fixed fairly easily, * optargs.scm (let-optional-template, let-keywords-template): Change "(begin body)" to "(let () body)" for empty bindings, since the former lets syntactically internal defines in body leak out to the surrounding environment. --=-=-= Content-Disposition: inline; filename=optargs.scm.begin.diff --- optargs.scm.~1.20.~ 2003-04-07 08:04:58.000000000 +1000 +++ optargs.scm 2004-09-07 09:16:29.000000000 +1000 @@ -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 @@ -125,7 +125,7 @@ (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) @@ -140,7 +140,7 @@ (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) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --=-=-=--