From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user Subject: Re: Define in let Date: Wed, 21 Aug 2013 13:01:41 +0200 Message-ID: References: <87k3jgb9kr.fsf@gnu.org> <20130820180137.301ace7e@capac> <20130821092851.GA16017@seid-online.de> <20130821103258.GB16017@seid-online.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf307cfec028a9b904e4731930 X-Trace: ger.gmane.org 1377082917 31833 80.91.229.3 (21 Aug 2013 11:01:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Aug 2013 11:01:57 +0000 (UTC) Cc: "guile-user@gnu.org" To: Ralf Mattes Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Aug 21 13:02:01 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 1VC6Ar-0007sM-0z for guile-user@m.gmane.org; Wed, 21 Aug 2013 13:02:01 +0200 Original-Received: from localhost ([::1]:52796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC6Aq-0003Zp-Ks for guile-user@m.gmane.org; Wed, 21 Aug 2013 07:02:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC6Ae-0003Zh-1D for guile-user@gnu.org; Wed, 21 Aug 2013 07:01:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VC6AY-0003Aw-92 for guile-user@gnu.org; Wed, 21 Aug 2013 07:01:47 -0400 Original-Received: from mail-vb0-x236.google.com ([2607:f8b0:400c:c02::236]:64678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC6AY-0003Aq-3h for guile-user@gnu.org; Wed, 21 Aug 2013 07:01:42 -0400 Original-Received: by mail-vb0-f54.google.com with SMTP id q14so174005vbe.41 for ; Wed, 21 Aug 2013 04:01:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zbtRgKEYg73L2E8WveFVCfyf7256eYglHka8ccDSv2I=; b=yTaRg+Iw056Hb4IGtYdN3nHbBOohsPp2/W8DU0ztdrzmbQl6WIuW36vRkvAro7gNIX aj5Wi4dsAyXPTDve07W8G0Nb1LdnC5swWTPD5r4q2SFYZdBU8SIpfSJmkCSvmkA/oysC 4/3PFwFhs3AVI7gafoLUnm3XR3T+crideEY4/JrH7jjQouQVaeIQioYQuabQk/sqgLVs JnNn5AaYYGF7j6VVyA7OvCt6IvIAHKDpG53fcyLQe73o6vsu/IV9kpJx1XBngY2Ufc8J o+EaHcvd9ELCfmJm7Gz6RlRpxc17PjHFY9oS71MZw5pRQoKG/+pYzIXBKGG/18saVW4F bqGQ== X-Received: by 10.52.34.40 with SMTP id w8mr5042754vdi.7.1377082901258; Wed, 21 Aug 2013 04:01:41 -0700 (PDT) Original-Received: by 10.221.45.135 with HTTP; Wed, 21 Aug 2013 04:01:41 -0700 (PDT) In-Reply-To: <20130821103258.GB16017@seid-online.de> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c02::236 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:10662 Archived-At: --20cf307cfec028a9b904e4731930 Content-Type: text/plain; charset=ISO-8859-1 2013/8/21 Ralf Mattes > On Wed, Aug 21, 2013 at 12:17:43PM +0200, Panicz Maciej Godek wrote: > > You're right, but it only works if you want to export only one symbol > > from a lexical scope. If you wanted a few procedures accessing > > a single scope, you'd either need to use the solution with 'set!', > > or -- as Taylan suggested -- have a "define-values" form. > > Yes, but was that the OP's question? > > Well, if the question is "to reduce scope of variable as much as possible", then I think that the issue of defining multiple procedures within the same scope is a part of that question, even if it wasn't posited directly > > Actually, I think should also be possible to write a "define-values" > > macro using the method I presented > [... snip ...] > > but somehow we need to generate identifiers for symbol1 symbol2 ... > > (here I wrote symbolically value1 value2 ..., but I'd appreciate if > someone > > more competent could provide a syntax-rules-based solution) > > Maybe it's time to point out that this question is in the Scheme-FAQ ;-) > [http://community.schemewiki.org/?scheme-faq-language] - Section > "Is there a way to define top-level closures?" (sorry, bad webdesign, > no wa to link directlyto the topic). The answer not only mentions > 'define-values but also links to an implementation: > [http://community.schemewiki.org/?scheme-faq-macros#multidefine] > that uses 'syntax-rules > > Thanks! :) --20cf307cfec028a9b904e4731930 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

= 2013/8/21 Ralf Mattes <rm@seid-online.de>
On Wed, Aug 21, 2013 at 12:17:43PM +0200, Panicz Maciej G= odek wrote:
> You're right, but it only works if you want to export only one sym= bol
> from a lexical scope. If you wanted a few procedures accessing
> a single scope, you'd either need to use the solution with 'se= t!',
> or -- as Taylan suggested -- have a "define-values" form.
Yes, but was that the OP's question?


Well, if the q= uestion is "to reduce scope of variable as much as possible",=
then I think that the issue of defining multiple procedures within= the same
scope is a part of that question, even if it= wasn't posited directly
=A0
> Actually, I think should also be possible to write a "define-valu= es"
> macro using the method I presented
[... snip ...]
> but somehow we need to generate identifiers for symb= ol1 symbol2 ...
> (here I wrote symbolically value1 value2 ..., but I'd appreciate i= f someone
> more competent could provide a syntax-rules-based solution)

Maybe it's time to point out that this question is in the Scheme-= FAQ ;-)
[http://community.schemewiki.org/?scheme-faq-language] - Sectio= n
"Is there a way to define top-level closures?" (sorry, bad webdes= ign,
no wa to link directlyto the topic). The answer not only mentions
'define-values but also links to an implementation:
[http://community.schemewiki.org/?scheme-faq-macros#multi= define]
that uses 'syntax-rules

Thanks! :)=A0

--20cf307cfec028a9b904e4731930--