unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#69919: Inaccurate api-procedures manual sentence on lambda formal arguments
@ 2024-03-20 17:40 Richard Sent
  0 siblings, 0 replies; only message in thread
From: Richard Sent @ 2024-03-20 17:40 UTC (permalink / raw)
  To: 69919

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.





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-20 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-20 17:40 bug#69919: Inaccurate api-procedures manual sentence on lambda formal arguments Richard Sent

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).