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.devel Subject: =?UTF-8?Q?Re:_[Patch]_definitions_in_when, __unless, __do_as_well_as_in_co?= =?UTF-8?Q?nd-_and_case-clauses?= Date: Thu, 17 Jun 2021 14:57:58 +0200 Message-ID: <2548315a-b028-443a-85e9-ebfd4758f701@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="6182"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-526-gf020ecf851-fm-20210616.001-gf020ecf8 To: "Maxime Devos" , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Thu Jun 17 15:17:29 2021 Return-path: Envelope-to: guile-devel@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 1ltrtg-0001Pj-6C for guile-devel@m.gmane-mx.org; Thu, 17 Jun 2021 15:17:28 +0200 Original-Received: from localhost ([::1]:42618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltrtf-0000Ub-5u for guile-devel@m.gmane-mx.org; Thu, 17 Jun 2021 09:17:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltrbI-0006KW-TO for guile-devel@gnu.org; Thu, 17 Jun 2021 08:58:28 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:45415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltrbG-0005UT-Ic for guile-devel@gnu.org; Thu, 17 Jun 2021 08:58:28 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 933A91628; Thu, 17 Jun 2021 08:58:22 -0400 (EDT) Original-Received: from imap42 ([10.202.2.92]) by compute1.internal (MEProxy); Thu, 17 Jun 2021 08:58:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryfast.biz; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type:content-transfer-encoding; s=fm2; bh=7RSjJ dUnMr8SrNh9TNDgdoe/Sb7J6Xov878+A+Ji3F4=; b=EphUdiuMK2tpWj4edhsge VXkYRuQzuVvTmqXZsOvEUtSVnOIDxaODnWMOuA5W8utWufyz9br5SYTeYky3fkrU SrsFsszwMqiS0TZiDv544amRD1tpm+j5KQqkXXH2lFqD16sYdL7WK5h3UuhX5AqD CYErc28LJ4qywCRuKUIwLNymjKyP0sGBwalJq2EgAwiXTX3IfOLWkmBU7J/L3b4r 8ci9RGGxoPnbprzyjm8RGyc5ZC/riXdDhEs7K7iALFgqu62uN/OxFHjuiWmsom9n 8lwCmoVNv/ZpvNpMwASfjQgF4tEgT6ihtyqzbHtrbv5am1mXSKcN0ODgOT3AME57 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=7RSjJdUnMr8SrNh9TNDgdoe/Sb7J6Xov878+A+Ji3 F4=; b=hY/vrDrYFFl0ZNQiirgrKQjKQvz0RMFpTMJwT5OHgb9CPSzhEo7ivKMIT bZ5o5dypRxxHS1Q/b6PN+RqG5a0Haz6CtJe//ymbBszg6y9bbz0f5dq2uPGkfvHF CV8sGuiBiLBpAeBQnnDxHWa3L2qPIEtSzJX2ehRiKsztFRxKOGQhu4crSfTj50XE MtGn5X7EC1SOW6tA56yOoFrcvn1ZeQwqlymY+sDVG2eSC69/Q4GzxnVWzrXQ2Fx6 N+vg+I0jWhjJZDnoA23HQ9R5hYoXz4HZV+tWwDjlz2clZZTxPWo6jEwXDHFOOyL4 flrfIfZccpOlsBNp8cy2FoWjxcm3Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeefuddgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpefnihhn uhhspgeujhpnrhhnshhtrghmuceolhhinhhushdrsghjohhrnhhsthgrmhesvhgvrhihfh grshhtrdgsihiiqeenucggtffrrghtthgvrhhnpeefffetjedttdevteelgeetvdehveeg tddtueeftedvtefhleehkeetkeehieeltdenucffohhmrghinheprheirhhsrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhhinhhu shdrsghjohhrnhhsthgrmhesvhgvrhihfhgrshhtrdgsihii X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id E05B43100062; Thu, 17 Jun 2021 08:58:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: Received-SPF: pass client-ip=64.147.123.20; envelope-from=linus.bjornstam@veryfast.biz; 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-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-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20783 Archived-At: Guile already does definitions in expression context in the bodies of la= mbda and let-variants. I think this is not a big problem since any valid= r6rs code is still valid guile. The discussion is in my opinion whether guile's r6rs modules should enfo= rce this behaviour. That might be a good thing, even though we will prov= ide 2 cons and case forms to do that. --=20 Linus Bj=C3=B6rnstam On Thu, 17 Jun 2021, at 11:06, Maxime Devos wrote: > Linus Bj=C3=B6rnstam schreef op wo 16-06-2021 om 21:11 [+0200]: > > Hi there! > >=20 > > This patch updates some derived conditional forms (and do and and-le= t*) > > to support definitions in expression context. Meaning it makes this = valid code: > >=20 > > (cond=20 > > ((pred? arg)=20 > > (define a (something arg)) > > (when (error-case a) > > (error "a is broken")) [...] >=20 > This seems a useful change to me. However, this is not valid R6RS. > From : >=20 > (cond hcond clause1i hcond clause2i . . . ) syntax > =3D> auxiliary syntax > else auxiliary syntax > Syntax: Each hcond clausei must be of the form > (htesti hexpression1i . . . ) > where htesti is an expression. Alternatively, a > hcond clausei may be of the form > (htesti =3D> hexpressioni) >=20 > This seems a compatibility pitfall, so maybe note > in the documentation that using definitions in the clauses > is a Guile and Racket extension and not standard R6RS? >=20 > (I try to write Scheme code as R6RS / R7RS library & define-library > forms, importing mostly R6RS / R7RS & SRFI libraries, though I occasio= nally > use a Guile extension.) >=20 > Greetings, > Maxime >=20 > Attachments: > * signature.asc