From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Bogatov Newsgroups: gmane.lisp.guile.user Subject: Re: Define in let Date: Wed, 21 Aug 2013 19:42:01 +0400 Organization: Church of Emacs Message-ID: <87ppt7f3ue.fsf@gnu.org> References: <87k3jgb9kr.fsf@gnu.org> <20130820180137.301ace7e@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1377099879 6891 80.91.229.3 (21 Aug 2013 15:44:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Aug 2013 15:44:39 +0000 (UTC) Cc: guile-user@gnu.org To: "David Pirotte" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Aug 21 17:44:42 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 1VCAaP-0006aJ-Lc for guile-user@m.gmane.org; Wed, 21 Aug 2013 17:44:41 +0200 Original-Received: from localhost ([::1]:54559 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCAaP-0003wq-BK for guile-user@m.gmane.org; Wed, 21 Aug 2013 11:44:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCAZh-000391-Eg for guile-user@gnu.org; Wed, 21 Aug 2013 11:44:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCAZd-0004cv-1v for guile-user@gnu.org; Wed, 21 Aug 2013 11:43:57 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCAZc-0004cq-Vl for guile-user@gnu.org; Wed, 21 Aug 2013 11:43:53 -0400 Original-Received: from [37.59.144.163] (port=50323 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1VCAZa-0002yb-Qo; Wed, 21 Aug 2013 11:43:52 -0400 User-agent: mu4e 0.9.9.5; emacs 24.3.1 In-reply-to: <20130820180137.301ace7e@capac> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:10663 Archived-At: --=-=-= Content-Type: text/plain >> 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? > > Section '3.4.7 Example 2: A Shared Persistent Variable' is probably what you want? Yes, although it is a bit too verbose. (define (foo x) (let ((a 2)) (+ a x0))) is enough for my puroses, although solution about define-values seems intresting. Thanks all! -- 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. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) iQIcBAEBAgAGBQJSFN/QAAoJEHiL4BJUt/ANPWQQAMBwiPuONXLng3Q39BsMKE5Q RyOMEynPC+pWjVD3vMsh6G7ghZJa1fr00Re671/Ks5a33VvlXO7jAg4csUvwQzvv ElyaoGpscXFWQSXYtz0U7RqWYlqT71WGT48uFVal5XIZGjrQOBr6kYq+551RlFbX mmtWOjjSurTTeCABU3g72JgsjApTJFsmsgu4JS5DmuVqaf6hevMQOzykDWQ7eX7O DxwgQHYKpzTnJUt0NoJ7l0lH9IuiNvV/NxxjBZ+1rolsV3cuoeHeW7J1OqS/c2Ar 2ZzUR8JlHmGVeaxuFJo5fZqCUIH8FsNIjnsDhc6UBztcUX+jbCZbZ13vTEmaVIaA /9yu1c/66qwWBdfnaXZCr1JeOyY8ECN10IQh3z0ybTwW67jnC8uY+Gbvap9JXSq+ y7I84LXj5yMQjgPCMj9KF/re/oPakkkpHluWmcbGwvmltfD5dbplnDxgdpMoW/Ph cq0bJa0ubUoTmy16ZhbIQmUlUG56m4tvAvsP2Gq8II+/QZ7TzxQIgt5xdugnLysY kXb6oxQh8tIQDhJy/zf/i9OgctFWn1z8/8x5HODFnbNNtfXLZ33ju+zcEb90xB3N lr0LgKzDYLHKcR0zfhSbyVl/FRLSJ9cwdDCo24aLUIfMvZ9kFnCm0qR4WuqANodD avw+6PgOE0PKTIVyibgx =YmBh -----END PGP SIGNATURE----- --=-=-=--