From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.user Subject: Re: Define in let Date: Tue, 20 Aug 2013 18:19:08 +0100 Message-ID: <87eh9o2sc3.fsf@Kagami.home> References: <87k3jgb9kr.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1377019167 20779 80.91.229.3 (20 Aug 2013 17:19:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 Aug 2013 17:19:27 +0000 (UTC) Cc: guile-user@gnu.org To: Dmitry Bogatov Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Aug 20 19:19:31 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 1VBpac-0007Vf-11 for guile-user@m.gmane.org; Tue, 20 Aug 2013 19:19:30 +0200 Original-Received: from localhost ([::1]:49114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBpab-0005AK-Jy for guile-user@m.gmane.org; Tue, 20 Aug 2013 13:19:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBpaR-00059B-DJ for guile-user@gnu.org; Tue, 20 Aug 2013 13:19:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBpaN-0003Ex-Ha for guile-user@gnu.org; Tue, 20 Aug 2013 13:19:19 -0400 Original-Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:39848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBpaN-0003Eg-BA; Tue, 20 Aug 2013 13:19:15 -0400 Original-Received: by mail-wi0-f178.google.com with SMTP id j17so229356wiw.17 for ; Tue, 20 Aug 2013 10:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:references:mail-followup-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=m2uJf9w9okr8w3axnIO6s49IJDb+WuulcJx4lRYM4f0=; b=HkPXpUJHux4Ju5rpQnFUEZX5gwk+s9R51P7uZNM+vWSNxezu24IoZTs3XAxb7CqxEt 1Ws1jIQuGVN9pOH1nXcl7kxXaHv/A7drqSJXOcX/tcrJWOy6/Dya7f7F4B5lY/KoeGVJ ZFzxerlY2B0Ket58cB4X/0QiQ+UctgHq2PmDkvTefG5bRS/yoo+Mi4RxvfGCGlSr4oM4 TKWUhMRq6SqbOcuX0mZECTBRe2QrXN1ODCIrd4lLvSqEiLrTF5EwZGqQuxYnRlwXbQ9Z Jh2dFjTQglh4vO5PFE7YfTFYjAANQpn5GprmcayHrQf55lssd3tL9mS180Kqe9SQzd8g TWAw== X-Received: by 10.194.23.196 with SMTP id o4mr2203975wjf.62.1377019154418; Tue, 20 Aug 2013 10:19:14 -0700 (PDT) Original-Received: from Kagami.home (host86-185-214-85.range86-185.btcentralplus.com. [86.185.214.85]) by mx.google.com with ESMTPSA id i12sm4105914wiw.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 20 Aug 2013 10:19:13 -0700 (PDT) Mail-Followup-To: Dmitry Bogatov , guile-user@gnu.org In-Reply-To: <87k3jgb9kr.fsf@gnu.org> (Dmitry Bogatov's message of "Tue, 20 Aug 2013 20:39:32 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::232 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:10653 Archived-At: Dmitry Bogatov writes: > 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? It's not a limitation, but a misunderstanding. Define creates a binding in the _current_ scope, not the top level one. -- Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"