From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Thompson, David" Newsgroups: gmane.lisp.guile.user Subject: Re: Define in let Date: Tue, 20 Aug 2013 12:57:15 -0400 Message-ID: References: <87k3jgb9kr.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bd6ad9cef71ed04e463f23c X-Trace: ger.gmane.org 1377017863 3913 80.91.229.3 (20 Aug 2013 16:57:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 Aug 2013 16:57:43 +0000 (UTC) Cc: Guile User To: Dmitry Bogatov Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Aug 20 18:57:44 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VBpFX-0001N1-L2 for guile-user@m.gmane.org; Tue, 20 Aug 2013 18:57:43 +0200 Original-Received: from localhost ([::1]:49034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBpFX-0006Te-B4 for guile-user@m.gmane.org; Tue, 20 Aug 2013 12:57:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBpFF-0006Jf-FF for guile-user@gnu.org; Tue, 20 Aug 2013 12:57:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBpF8-0003Xa-Ux for guile-user@gnu.org; Tue, 20 Aug 2013 12:57:25 -0400 Original-Received: from na3sys009aog134.obsmtp.com ([74.125.149.83]:53800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBpF8-0003XI-N9 for guile-user@gnu.org; Tue, 20 Aug 2013 12:57:18 -0400 Original-Received: from mail-qa0-f51.google.com ([209.85.216.51]) (using TLSv1) by na3sys009aob134.postini.com ([74.125.148.12]) with SMTP ID DSNKUhOf7GTXylyq6QFIkuTxI7CMacEXljR0@postini.com; Tue, 20 Aug 2013 09:57:18 PDT Original-Received: by mail-qa0-f51.google.com with SMTP id f11so473175qae.10 for ; Tue, 20 Aug 2013 09:57:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=R+xpuzlgSodt1LeaZ7N1YiETHr5EsdDMSrfJNTnPtPo=; b=XC7l6oiWokQXJM6GxYkZWOsaXqChfBpdraguB9epXcaYizj5k0bf5o7vQ5RaFV/RJH c601nlX+yGQE+X997iBwFaG18Wgh8n/NbnCvks6KrjPVR+QBHLV8YuqnDaxNGcoRLeUl FHV3pVg8DlVc+kJtwp3wcn5wZ2VYMlQf1kvPXP2ypSKW2BguX1l0IaQL/dDZSAFmClIv ALd9soXEJACyLDWpVef1ihsYbeJSJRKvB56RC9v0XY6D9Eky6dTRiMzFBm6p4YLVVn02 CX8K9pLWotanu/NpfU4vje5sx+ZwHccaE+ZZAGB1xO6xWrlPDA5HvW3PfQUAN4JHzlL7 dxIQ== X-Gm-Message-State: ALoCoQlmxIcqO3KZbK5VuHR/+8DG4rF7f38uZVniR3NoClVk0FDVdwSWlkg6LUhmVMMjuQ+ODJ6JJjc3sfXwlgCpmoy8yazWV9th7d3Roj9RA3h39cSZ6I4MXnzKPhASyOT5k/lMB1it9gIU/gCNrcBjFbWWm8jahw== X-Received: by 10.49.28.74 with SMTP id z10mr3439197qeg.4.1377017835585; Tue, 20 Aug 2013 09:57:15 -0700 (PDT) X-Received: by 10.49.28.74 with SMTP id z10mr3439186qeg.4.1377017835503; Tue, 20 Aug 2013 09:57:15 -0700 (PDT) Original-Received: by 10.49.38.38 with HTTP; Tue, 20 Aug 2013 09:57:15 -0700 (PDT) In-Reply-To: <87k3jgb9kr.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 74.125.149.83 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10651 Archived-At: --047d7bd6ad9cef71ed04e463f23c Content-Type: text/plain; charset=ISO-8859-1 On Tue, Aug 20, 2013 at 12:39 PM, Dmitry Bogatov wrote: > > It seems following is invalid: > > (let ((a 2)) > (define (foo x) (+ a x))) > > I prefer to reduce scope of variable as much as possible, so > I find this restriction unconvinent. Is is part of standard or technical > limitation? Is it any workaround? > The problem is that you have an invalid `let` form. You need an expression besides `define`. Something like this would be valid: (let ((a 2)) (define (foo x) (+ a x)) (foo 4)) > > Please, keep in CC, I am not subscribed. > > -- > Best regards, Dmitry Bogatov , > Free Software supporter and netiquette guardian. > git clone git://kaction.name/rc-files.git --depth 1 > GPG: 54B7F00D > Html mail and proprietary format attachments are forwarded to /dev/null. > - Dave Thompson --047d7bd6ad9cef71ed04e463f23c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On T= ue, Aug 20, 2013 at 12:39 PM, Dmitry Bogatov <KAction@gnu.org> wrote:

It seems following is invalid:

=A0 =A0(let ((a 2))
=A0 =A0 =A0 =A0 (define (foo x) (+ a x)))

I prefer to reduce scope of variable as much as possible, so
I find this restriction unconvinent. Is is part of standard or technical limitation? Is it any workaround?


T= he problem is that you have an invalid `let` form. You need an expression b= esides `define`.

Something like this would be valid:

(let ((a 2))
=A0 (define (foo x) (+ a x))
=A0 (foo 4))
=A0

Please, keep in CC, I am not subscribed.

--
Best regards, Dmitry Bogatov <KAction= @gnu.org>,
Free Software supporter and netiquette guardian.
=A0 =A0 =A0 =A0 git clone git://kaction.name/rc-files.git --depth 1
=A0 =A0 =A0 =A0 GPG: 54B7F00D
Html mail and proprietary format attachments are forwarded to /dev/null.

- Dave Thompson

--047d7bd6ad9cef71ed04e463f23c--