From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel Subject: Re: Should letrec via syntax work within eval-when (expand load eval)? Date: Mon, 05 Aug 2019 20:33:37 -0500 Message-ID: <87r25zt6vi.fsf@trouble.defaultvalue.org> References: <87lfwgl1wt.fsf@trouble.defaultvalue.org> <87blx8v5s1.fsf@trouble.defaultvalue.org> <87zhkn8ppe.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="121555"; mail-complaints-to="usenet@blaine.gmane.org" Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Aug 06 03:33:51 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1huoMH-000VW7-Gt for guile-devel@m.gmane.org; Tue, 06 Aug 2019 03:33:49 +0200 Original-Received: from localhost ([::1]:58040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huoMG-0006yu-AW for guile-devel@m.gmane.org; Mon, 05 Aug 2019 21:33:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45719) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1huoM7-0006yc-2r for guile-devel@gnu.org; Mon, 05 Aug 2019 21:33:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1huoM6-0006sm-2V for guile-devel@gnu.org; Mon, 05 Aug 2019 21:33:39 -0400 Original-Received: from defaultvalue.org ([45.33.119.55]:38182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1huoM5-0006si-Uc for guile-devel@gnu.org; Mon, 05 Aug 2019 21:33:38 -0400 Original-Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id AC63C203FF; Mon, 5 Aug 2019 20:33:37 -0500 (CDT) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 4199414E066; Mon, 5 Aug 2019 20:33:37 -0500 (CDT) In-Reply-To: <87zhkn8ppe.fsf@netris.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 45.33.119.55 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 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 Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20032 Archived-At: Mark H Weaver writes: > The 'letrec' form above is indeed invalid. As the R5RS states: > > One restriction on 'letrec' is very important: it must be possible > to evaluate each without assigning or referring to the value > of any . If this restriction is violated, then it is an > error. The restriction is necessary because Scheme passes > arguments by value rather than by name. In the most common uses of > 'letrec', all the s are lambda expressions and the > restriction is satisfied automatically. Yeah, I'd read that originally, but not paid quite close enough attention (obviously). Switching to a wrapper lambda worked just fine. > This particular example happens to work when compiled by recent versions > of Guile, but that's suboptimal. Ideally, we should report an error in > this case. Indeed, not strictly necessary, but would have been nice, so I'd have realized more quicly that I was doing it wrong. Thanks again for the help. -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4