From: lloda <lloda@sarc.name>
To: "Linus Björnstam" <linus.bjornstam@veryfast.biz>
Cc: Lassi Kortela <lassi@lassi.io>,
"guile-devel@gnu.org" <guile-devel@gnu.org>
Subject: Re: Add internal definitions to derived forms
Date: Thu, 19 Jan 2023 18:54:47 +0100 [thread overview]
Message-ID: <D8B7DB46-36AB-426C-B566-AD2DB9B7A4AC@sarc.name> (raw)
In-Reply-To: <2ffeb6fa-87eb-4008-9881-91b3e71a1fc3@app.fastmail.com>
[-- Attachment #1: Type: text/plain, Size: 142 bytes --]
Attached a patch that applies after yours and refers to the explanation of bodies elsewhere in the manual. Wdyt?
Regards
Daniel
[-- Attachment #2: 0001-Fix-doc-for-conditional-forms-taking-lambda-like-bod.patch --]
[-- Type: application/octet-stream, Size: 2418 bytes --]
From bd68ff5a593b3747b1efed75ca54f2b5eeec8230 Mon Sep 17 00:00:00 2001
From: Daniel Llorens <lloda@sarc.name>
Date: Thu, 19 Jan 2023 16:23:29 +0100
Subject: [PATCH] Fix doc for conditional forms taking lambda-like bodies
* doc/ref/api-control.texi (Simple Conditional Evaluation): Use 'body'
in the syntax description of when, unless, cond, case.
---
doc/ref/api-control.texi | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/doc/ref/api-control.texi b/doc/ref/api-control.texi
index ece6a6020..7ad52e080 100644
--- a/doc/ref/api-control.texi
+++ b/doc/ref/api-control.texi
@@ -142,13 +142,13 @@ an expression that is evaluated for effect, not for value).
In such a case, it is considered more clear to express these intentions
with these special forms, @code{when} and @code{unless}. As an added
-bonus, these forms accept multiple statements to evaluate, which are
-implicitly wrapped in a @code{begin}.
+bonus, these forms take a @ref{Local Bindings,lambda-like body}, which can
+contain @ref{Internal Definitions,internal definitions} and multiple statements
+to evaluate.
-@deffn {Scheme Syntax} when test statement1 statement2 ...
-@deffnx {Scheme Syntax} unless test statement1 statement2 ...
-The actual definitions of these forms are in many ways their most clear
-documentation:
+@deffn {Scheme Syntax} when test body
+@deffnx {Scheme Syntax} unless test body
+The actual definitions of these forms may be their most clear documentation:
@example
(define-syntax-rule (when test stmt stmt* ...)
@@ -167,11 +167,10 @@ statements if @var{test} is false.
Each @code{cond}-clause must look like this:
@lisp
-(@var{test} @var{body} @dots{})
+(@var{test} @var{body})
@end lisp
-where @var{test} is an arbitrary expression and @var{body} is a
-lambda-like body, or like this
+where @var{test} is an arbitrary expression, or like this
@lisp
(@var{test} => @var{expression})
@@ -217,7 +216,7 @@ result of the @code{cond}-expression.
@var{key} may be any expression, and the @var{clause}s must have the form
@lisp
-((@var{datum1} @dots{}) @var{body} @dots{})
+((@var{datum1} @dots{}) @var{body})
@end lisp
or
@@ -229,7 +228,7 @@ or
and the last @var{clause} may have the form
@lisp
-(else @var{expr1} @var{body} @dots{})
+(else @var{body})
@end lisp
or
--
2.30.2
next prev parent reply other threads:[~2023-01-19 17:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 15:32 Add internal definitions to derived forms Linus Björnstam
2022-11-09 15:46 ` Damien Mattei
2022-11-17 7:25 ` lloda
2022-11-18 9:04 ` Linus Björnstam
2022-11-18 9:27 ` Lassi Kortela
2022-11-18 9:50 ` Linus Björnstam
2022-11-18 10:22 ` Lassi Kortela
2022-11-18 12:53 ` Linus Björnstam
2022-11-18 13:18 ` Lassi Kortela
2023-01-19 17:54 ` lloda [this message]
2023-01-20 17:37 ` lloda
2023-01-23 22:13 ` Ludovic Courtès
2023-01-23 23:28 ` lloda
2023-01-24 7:33 ` Linus Björnstam
2023-01-24 9:02 ` Ludovic Courtès
2023-01-24 17:59 ` lloda
2023-01-25 10:33 ` Ludovic Courtès
2023-01-25 15:09 ` Ludovic Courtès
2023-01-25 15:38 ` Greg Troxel
2023-01-25 21:38 ` Linus Björnstam
2023-01-25 21:06 ` Linus Björnstam
2023-02-02 11:17 ` lloda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D8B7DB46-36AB-426C-B566-AD2DB9B7A4AC@sarc.name \
--to=lloda@sarc.name \
--cc=guile-devel@gnu.org \
--cc=lassi@lassi.io \
--cc=linus.bjornstam@veryfast.biz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).