From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.devel Subject: Re: [Patch] definitions in when, unless, do as well as in cond- and case-clauses Date: Thu, 17 Jun 2021 11:06:37 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-rOKaT9g/aNiDypEdqE7x" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11290"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.34.2 To: Linus =?ISO-8859-1?Q?Bj=F6rnstam?= , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Thu Jun 17 11:07:18 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 1ltnzZ-0002lO-IW for guile-devel@m.gmane-mx.org; Thu, 17 Jun 2021 11:07:17 +0200 Original-Received: from localhost ([::1]:52810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltnzY-00032r-Kb for guile-devel@m.gmane-mx.org; Thu, 17 Jun 2021 05:07:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltnzM-00032Q-LJ for guile-devel@gnu.org; Thu, 17 Jun 2021 05:07:04 -0400 Original-Received: from andre.telenet-ops.be ([2a02:1800:120:4::f00:15]:58784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltnzJ-0004DE-RJ for guile-devel@gnu.org; Thu, 17 Jun 2021 05:07:04 -0400 Original-Received: from butterfly.local ([188.189.1.128]) by andre.telenet-ops.be with bizsmtp id J96t2500Y2liavw0196vF5; Thu, 17 Jun 2021 11:06:57 +0200 In-Reply-To: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1623920818; bh=qyb5N3mWkPKSCWKCylRWlT56NWhuSSh/E/ApOebIg/E=; h=Subject:From:To:Date:In-Reply-To:References; b=Tt67NvgkZE8SdIxrqOxmdj/4I69SA8Bl1FM3rscUwPYg+vpeJpLNP4ekQJC+on74G gDKOxAhvCi46PVie1YYZiPqCmAMOHkMwEBQzEgUjSL+lsZ0tiWC3VwiTFGen+w9gAa S0mNwYOfJw3fOUFWJq/1xCxg54aaH99nq1HlLlmQYwcBSJGRHXogdWk4aGkIl2/OVa v4+fBRWHZ7uI9LMBHuUgLccvcDTNzU3ao4c/AxRbJadhx+Ipl7E8I+g8ovXZtYVW/+ j94iL4LoVl6ooou2+BnOQZiycLBI0MPZemfLLoG/Q43YY0Blh+uo6F8NB6jgc4r8i1 /f4LDiHFKLq7A== Received-SPF: pass client-ip=2a02:1800:120:4::f00:15; envelope-from=maximedevos@telenet.be; helo=andre.telenet-ops.be 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, SPF_HELO_NONE=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:20782 Archived-At: --=-rOKaT9g/aNiDypEdqE7x Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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-let*) > 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")) [...] This seems a useful change to me. However, this is not valid R6RS. =46rom : (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) 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? (I try to write Scheme code as R6RS / R7RS library & define-library forms, importing mostly R6RS / R7RS & SRFI libraries, though I occasionally use a Guile extension.) Greetings, Maxime --=-rOKaT9g/aNiDypEdqE7x Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYMsQnxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gC5AP4lKEfNGO8xRavgYNiifs5pC/Ey AVhCOcpyvYbD1NCxbAEA4Sqzm4Zvdj0e5AXSSuuqu7WSEwxe6uqZ0FhIjZSeBQ0= =Eg+w -----END PGP SIGNATURE----- --=-rOKaT9g/aNiDypEdqE7x--