bug#69919: Inaccurate api-procedures manual sentence on lambda formal arguments

Richard Sent <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.