From: Richard Sent <richard@freakingpenguin.com>
To: 69919@debbugs.gnu.org
Subject: bug#69919: Inaccurate api-procedures manual sentence on lambda formal arguments
Date: Wed, 20 Mar 2024 13:40:58 -0400 [thread overview]
Message-ID: <87h6h0dcnp.fsf@freakingpenguin.com> (raw)
Hi Guile,
I noticed the following line in the manual on (lambda) in (info "(guile)
Lambda"). Emphasis in **.
> -- syntax: lambda formals body
> ...
> ‘(VARIABLE1 ... VARIABLEN . VARIABLEN+1)’
> If a space-delimited period precedes the last variable, then
> the procedure takes N or more variables where N is the number
> of formal arguments before the period. *There must be at
> least one argument before the period.*
That would mean a procedure like
--8<---------------cut here---------------start------------->8---
((lambda ( . args)
args) 1) ;=>(1) runs fine in 3.0.9
--8<---------------cut here---------------end--------------->8---
is invalid because there isn't an argument before the period. I've
encountered Guile code that relies on this behavior before, even in the
Guile repo. For example, in guile/benchmark/measure.scm:
--8<---------------cut here---------------start------------->8---
(define (measure . args)
...)
;; should be identical to
(define measure (lambda ( . args) ...))
--8<---------------cut here---------------end--------------->8---
Ergo, I think the sentence
> There must be at least one argument before the period
should be removed. This line seems to be from the R5RS standard [1], but
this sentence is in api-procedures.texi, not the R5RS manual, so I
assume it should reflect Guile's implementation.
[1] https://conservatory.scheme.org/schemers/Documents/Standards/R5RS/HTML/r5rs-Z-H-2.html#%_toc_%_sec_4.1.4
--
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.
reply other threads:[~2024-03-20 17:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=87h6h0dcnp.fsf@freakingpenguin.com \
--to=richard@freakingpenguin.com \
--cc=69919@debbugs.gnu.org \
/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).