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: Re: Add internal definitions to derived forms Date: Tue, 24 Jan 2023 08:33:45 +0100 Message-ID: References: <2f38c5ea-0cb6-494e-b680-70b39c3291fb@app.fastmail.com> <38A58B58-3E5C-48EA-A108-1255982789DF@sarc.name> <39109fe3-4f7f-8d07-51ba-f9f993ab5c0d@lassi.io> <8187541f-a4e0-2f26-e8b7-df7fb82bb9f0@lassi.io> <2ffeb6fa-87eb-4008-9881-91b3e71a1fc3@app.fastmail.com> <87h6wgzyqb.fsf@gnu.org> <588FD427-B3C2-4946-83E9-74978E2D3C62@sarc.name> 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="26938"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.9.0-alpha0-85-gd6d859e0cf-fm-20230116.001-gd6d859e0 Cc: "guile-devel@gnu.org" , "Lassi Kortela" To: lloda , =?UTF-8?Q?Ludovic_Court=C3=A8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Jan 24 08:34:59 2023 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 1pKDpZ-0006cZ-8H for guile-devel@m.gmane-mx.org; Tue, 24 Jan 2023 08:34:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKDp0-0004uW-OU; Tue, 24 Jan 2023 02:34:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKDoy-0004u7-AU for guile-devel@gnu.org; Tue, 24 Jan 2023 02:34:20 -0500 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKDov-0005sn-Oy; Tue, 24 Jan 2023 02:34:19 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id E21C732002E8; Tue, 24 Jan 2023 02:34:10 -0500 (EST) Original-Received: from imap51 ([10.202.2.101]) by compute2.internal (MEProxy); Tue, 24 Jan 2023 02:34:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryfast.biz; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1674545650; x= 1674632050; bh=Wx2oE5j9SFkPsyKKhLwgbz8GiaVmwBNT4FSX0nqmOHs=; b=x FOuIXv563txc2enoDwIntZgnMS/7BUnBMTDKUVO7wBMNXzkmm8APgfUrebZySMxc IjIG1wGtiZ3mS1Ci4vye6uXcvSNTqe9FHJYuK4LNBG5qScP7gSf8AcM5GKPl7KwO KQE5StdhASWQBu1/KhO7V8EGtDBzFHDpem4EApsmeeNPb6cczlczbD6OIvDWyj24 3kdhVX62oE0klYrvXouoSu+YTf9fXz/ZXS53L9pGDdSZUDfiG6HdTfManMi7uguh QNFtj/s3d3rQCSuDM1s62Ex2P8Y39SFhnjF+M3r7BC0Obr4oREGyn+j36VoBOlIH 6lGNkZhUsWLd7cxnZOnCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1674545650; x= 1674632050; bh=Wx2oE5j9SFkPsyKKhLwgbz8GiaVmwBNT4FSX0nqmOHs=; b=J cFhmuXbWOl0vKCJtKZxqVW7xr9p8cj8YclHRwNMYLRt2JixBHsm16B+dWthByr4r Ls6+r8lmUSG7OoeM7lqRfb3mkxSvIWTOfwS44WiqpivbC0LiYHf+huKCTpvnVYmi 6axRWNZMD9fmitXjWd73CphiFK+6nZLBwWjwRVybSi+GiFctfp6TOK0mFOD5B3sT tfUNMz6G/gLInvZ5iIcfCnCNp5VvKRBWLraeUg/uPOZNe4jq9mbSxUSDRIwhJi45 M24/nT4DhQURq0qnNw7wrcTuLxNI0bOQmk2wkLm0S7bktmDc6SD6w6iFYGgXV5nG yMc0Wm9xtD1Ro7OWZ42Mg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduledgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpefn ihhnuhhsuceujhpnrhhnshhtrghmuceolhhinhhushdrsghjohhrnhhsthgrmhesvhgvrh ihfhgrshhtrdgsihiiqeenucggtffrrghtthgvrhhnpeekgeeuudeugffhgfdvveelteei tdduvedtjeegieevgfelheelteevhfettdelfeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehlihhnuhhsrdgsjhhorhhnshhtrghmsehvvghr hihfrghsthdrsghiii X-ME-Proxy: Feedback-ID: i51694465:Fastmail Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id ACC2FB60086; Tue, 24 Jan 2023 02:34:05 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <588FD427-B3C2-4946-83E9-74978E2D3C62@sarc.name> Received-SPF: pass client-ip=64.147.123.19; envelope-from=linus.bjornstam@veryfast.biz; helo=wout3-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, 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.29 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-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21623 Archived-At: Hi! Sorry about the delay, I have an updated patch somewhere, but I started = working after 4 months paternity leave and family life's fortunes has it= so that I haven't used a computer since the last time I wrote an email = in this thread (this is written on a phone). This is likely how will be in the foreseeable future, despite me having = bought an analog keyboard to turn into some kind of music instrument :) For what it is worth: The body ... was taken from and-let* and the newer patch was changed to = follow the description of let. And "lambda-like body" was changed to "le= t-expression body". I will not have the ability to address anything nor actually send my upd= ates patch for what is probably months. If anyone wants to take over I w= ould be happy. For what it is worth, I have already signed a copyright a= ssignment to the FSF.=20 Best regards Linus Bj=C3=B6rnstam (manumanumanu) On Tue, 24 Jan 2023, at 00:28, lloda wrote: > Hi Ludovic, > >> On 23 Jan 2023, at 23:13, Ludovic Court=C3=A8s wrote: >>=20 >> Hi Daniel, >>=20 >> Chiming in late in the discussion=E2=80=A6 >>=20 >> lloda skribis: >>=20 >>> From 7aea299373f7370f31c9701035260ad412763724 Mon Sep 17 00:00:00 20= 01 >>> From: Daniel Llorens >>> Date: Thu, 19 Jan 2023 16:23:29 +0100 >>> Subject: [PATCH 2/2] Fix documentation for forms taking lambda-like = bodies >>>=20 >>> * doc/ref/api-control.texi (Conditionals): Use 'body' in the syntax >>> description of when, unless, cond, case. >>> * doc/ref/api-binding.texi (Local Bindings): Normalize description of >>> body return values. >>> (Multiple values): Normalize use of 'body' and description of body >>> return values. >>=20 >> What about: >> s/Fix documentation=E2=80=A6/doc: Document multiple-value returns in = let, cond, etc./ >> ? >>=20 >> (That would clarify what=E2=80=99s being fixed.) > > Ok. > >>=20 >>> +++ b/doc/ref/api-binding.texi >>> @@ -128,6 +128,8 @@ expressions has a few properties which are well = worth knowing. >>>=20 >>> The most basic local binding construct is @code{let}. >>>=20 >>> +@cindex body >>=20 >> That=E2=80=99s not a great index entry because there=E2=80=99s no con= text. Maybe: >>=20 >> @cindex body, of a @code{let} expression >>=20 >> ? > > Ok. I think the word is only used in this sense in the manual, but it=20 > might too generic to be used alone. > >>> +with the special forms @code{when} and @code{unless}. As an added >>> +bonus, these forms take a @ref{Local Bindings,lambda-like body}, wh= ich can >>> +contain @ref{Internal Definitions,internal definitions} and multipl= e statements >>> +to evaluate. >>=20 >> =E2=80=9CLambda-like body=E2=80=9D is not defined; I guess it=E2=80=99= s =E2=80=9Clambda-like=E2=80=9D in the >> wrt. to local =E2=80=98define=E2=80=99, but it=E2=80=99s not =E2=80=9C= lambda-like=E2=80=9D for the more crucial >> aspect of defining a procedure, so I=E2=80=99d avoid that phrase. WD= YT? > > Yes, I thought lambda-like was a tad distracting, so I went with 'body= ' alone... > >> Also, @ref in the middle of sentences may render poorly in Info (info >> "(texinfo) @ref"). I=E2=80=99d suggest =E2=80=9C(@pxref{Whatever})=E2= =80=9D at the end of the >> sentence or proposition. > > Ok. > >>> Each @code{cond}-clause must look like this: >>>=20 >>> @lisp >>> -(@var{test} @var{body} @dots{}) >>> +(@var{test} @var{body}) >>=20 >> I think removing dots is incorrect here because it suggests, according >> to the typographic conventions used in the document, that there can o= nly >> be a single expression. >>=20 >>> @var{key} may be any expression, and the @var{clause}s must have the= form >>>=20 >>> @lisp >>> -((@var{datum1} @dots{}) @var{body} @dots{}) >>> +((@var{datum1} @dots{}) @var{body}) >>=20 >> Ditto. >>=20 >>> and the last @var{clause} may have the form >>>=20 >>> @lisp >>> -(else @var{expr1} @var{body} @dots{}) >>> +(else @var{body}) >>=20 >> Ditto. >>=20 >>> -@deffn {library syntax} receive formals expr body @dots{} >>> +@deffn {library syntax} receive formals expr body >>=20 >> Likewise. > > This was actually the main thing I wanted to fix in this patch. Linus'=20 > patch had =E2=80=98body ...=E2=80=99 but that clearly means =E2=80=98z= ero or more bodies=E2=80=99,=20 > which doesn't work because there's exactly one =E2=80=98body=E2=80=99.= I.e. =E2=80=98body=E2=80=99=20 > isn't an expression that is tagged =E2=80=98body=E2=80=99, it's, well,= a =E2=80=98body=E2=80=99. > > The Scheme reports use one =E2=80=98=E2=80=99 and no dots in all= these=20 > definitions. See also the definition of let in the linked section=20 > =E2=80=98Local Bindings=E2=80=99, which again uses =E2=80=98body=E2=80= =99 and no dots. I hoped that=20 > section would count as definition of =E2=80=98body=E2=80=99, and the s= ection on=20 > =E2=80=98Internal Definitions=E2=80=99 explains precisely what can go = into =E2=80=98body=E2=80=99, so I=20 > linked to that as well. I see that isn't clear enough. Maybe =E2=80=98= body=E2=80=99=20 > should be explicitly defined in one of these sections? > >> Otherwise LGTM; it=E2=80=99s certainly an improvement to have multipl= e-value >> returns properly documented! >>=20 >> Thanks, >> Ludo=E2=80=99.