From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.user Subject: Re: strange error message in macro Date: Thu, 01 Jul 2021 10:02:23 +0200 Message-ID: <939e760a-dfd3-41df-97e8-728c49121b27@www.fastmail.com> References: Mime-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5653"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-530-gd0c265785f-fm-20210616.002-gd0c26578 To: "Damien Mattei" , guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Jul 01 10:03:24 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyrfO-0001A7-I8 for guile-user@m.gmane-mx.org; Thu, 01 Jul 2021 10:03:23 +0200 Original-Received: from localhost ([::1]:49808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyrfN-0007Y8-JR for guile-user@m.gmane-mx.org; Thu, 01 Jul 2021 04:03:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyrf7-0007Xh-Dz for guile-user@gnu.org; Thu, 01 Jul 2021 04:03:06 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:55857) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyrf0-0007LH-FR for guile-user@gnu.org; Thu, 01 Jul 2021 04:03:05 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 222343200935; Thu, 1 Jul 2021 04:02:54 -0400 (EDT) Original-Received: from imap43 ([10.202.2.93]) by compute5.internal (MEProxy); Thu, 01 Jul 2021 04:02:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.se; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type:content-transfer-encoding; s=fm3; bh=xrFlZ TEGbJm98beOWWDkA+TZPlwDQ/pujbmSbS6VJb4=; b=NFBCbfnuzT3u1mkhAJJje 1twdOXqHJFImYAmUT6iiqya44e2c4lQLQD7KsAqsFDI5eLlFPggWp0Z8PLkjU5Ls k8DgJ6U6HpTc2ankaQCBuGLxIe26UvxlWy6dczv63X5oI52KDw6AaL2PJiNZ89WQ xiM5Sw1qDdPlkf7U8UV9Ul64am+XhzR5h2Y9elh3mKCdMKkhmW+lzSSl2gJOhbqx nJFkGITrolUDc+LzajNcnXI48yj4dB8ay1tBayGlCehJojmYOrH17v4ClI5Llt5M L1eUj1mekzgnpn6g11OfahMJHtcqKa9bj54X3zz5tndfdJQ24x/gC6GF8b+z9Mxy g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=xrFlZTEGbJm98beOWWDkA+TZPlwDQ/pujbmSbS6VJ b4=; b=YctPt9A9onHGtPsCdZ2ib6Bhi83WuuSuiK0gpGsx8BYEYQ8jgkB1KnVSU 461Kpxz1wX/DfCQERS2XXRCn4npIORVCfvzfDyh7eL1Y3VA/r3zKU0bac1KTzMw9 ronj5tB81htOKJe9gQHQ0gX0WITHLKbVrEtbEg/ab+hQFvivtmv61qiW7NbHNpl/ F2ke9usG6LougQWEtR5jahkPt7Op2BwsEPtKob1J0QgS7oe4Rrpfb5KHAbHMvxvf Uihaygq8fpCTHrX5BduJLQYuk44xZxPXpHsQymiOP0e0p+E60uVHs38NkIqOCeI8 m91MH1A/Rigj4dZizv9wCnupq8Adw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeeihedguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepnfhi nhhushgpuehjnphrnhhsthgrmhcuoehlihhnuhhsrdhinhhtvghrnhgvthesfhgrshhtmh grihhlrdhsvgeqnecuggftrfgrthhtvghrnhepkeelveeiveeljeffteeiledtleekveet udehfeehudeifffftddtgeejieehtdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheplhhinhhushdrihhnthgvrhhnvghtsehfrghsthhmrghi lhdrshgv X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 664A6AC0076; Thu, 1 Jul 2021 04:02:53 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: Received-SPF: pass client-ip=64.147.123.20; envelope-from=linus.internet@fastmail.se; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17638 Archived-At: Begin in a Body is spliced into the body. Begin as an expression chain i= s not spliced, and needs at least one expression. So: begin in definition context (directly in function bodies and at top-= level) can have 0 expressions. Begin in other contexts must have at leas= t one expression. --=20 Linus Bj=C3=B6rnstam On Thu, 1 Jul 2021, at 09:34, Damien Mattei wrote: > hello, > 'begin' complains of 'sequence of zero expressions in form (begin)' > in: > scheme@(guile-user)> ($ {x <- 7} {y <- 8} (+ x y)) > While compiling expression: > Syntax error: > unknown file:2:0: sequence of zero expressions in form (begin) > but: > scheme@(guile-user)> (begin ) > make no error ! > basically $ is a sort of begin macro that call : > (define-syntax %parse-assignment > (syntax-rules () > ... >=20 > if i wrote: > (define-syntax %parse-assignment > (syntax-rules (<-) > there is no more error: > scheme@(guile-user)> ($ {x <- 7} {y <- 8} (+ x y)) > ;;; :5:0: warning: possibly unbound variable `x' > ;;; :5:0: warning: possibly unbound variable `y' > 15 > result is 15 and good! >=20 > i think that the explanation is with syntax-rules parameters not with > begin that would not accept zero expression in form , so why this stra= nge > message? > i suppose i have trouble understanding the behavior and use of syntax-= rules > parameters anyway and can not find any reliable documentation about it= . >=20 > Damien >=20