GNU bug report logs - #75413
Fix faulty example of SRFI-31 in the manual.

Previous Next

Package: guile;

Reported by: Yuval Langer <yuval.langer <at> gmail.com>

Date: Mon, 6 Jan 2025 23:56:02 UTC

Severity: normal

Done: lloda <lloda <at> sarc.name>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 75413 <at> debbugs.gnu.org (full text, mbox):

From: Rob Browning <rlb <at> defaultvalue.org>
To: Yuval Langer <yuval.langer <at> gmail.com>, 75413 <at> debbugs.gnu.org
Subject: Re: bug#75413: Fix faulty example of SRFI-31 in the manual.
Date: Mon, 06 Jan 2025 19:23:31 -0600
Yuval Langer <yuval.langer <at> gmail.com> writes:

> diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
> index d77bc1c90..1373409f0 100644
> --- a/doc/ref/srfi-modules.texi
> +++ b/doc/ref/srfi-modules.texi
> @@ -3367,8 +3367,9 @@ The second syntax can be used to create anonymous recursive functions:
>  
>  @lisp
>    guile> (define tmp (rec (display-n item n)
> -                       (if (positive? n)
> -                           (begin (display n) (display-n (- n 1))))))
> +                       (when (positive? n)
> +                           (display item)
> +                           (display-n item (- n 1)))))
>    guile> (tmp 42 3)
>    424242
>    guile>

Looks good overall -- strictly speaking, might need a (newline) in there
if we want the output to match (or the output could be changed).

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4




This bug report was last modified 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.