unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#75413: Fix faulty example of SRFI-31 in the manual.
@ 2025-01-06 23:54 Yuval Langer
  2025-01-07  1:23 ` Rob Browning
  2025-01-20 19:58 ` lloda
  0 siblings, 2 replies; 5+ messages in thread
From: Yuval Langer @ 2025-01-06 23:54 UTC (permalink / raw)
  To: 75413

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-Fix-faulty-SRFI-31-example.patch --]
[-- Type: text/x-patch, Size: 919 bytes --]

From aac75ef98ca6b008fd7d16f42dcb90d22b8ed43c Mon Sep 17 00:00:00 2001
From: Yuval Langer <yuvallangerontheroad@gmail.com>
Date: Fri, 3 Jan 2025 06:37:43 +0200
Subject: [PATCH] Fix faulty SRFI-31 example.

---
 doc/ref/srfi-modules.texi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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>
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#75413: Fix faulty example of SRFI-31 in the manual.
  2025-01-06 23:54 bug#75413: Fix faulty example of SRFI-31 in the manual Yuval Langer
@ 2025-01-07  1:23 ` Rob Browning
  2025-01-09  4:01   ` Yuval Langer
  2025-01-20 19:58 ` lloda
  1 sibling, 1 reply; 5+ messages in thread
From: Rob Browning @ 2025-01-07  1:23 UTC (permalink / raw)
  To: Yuval Langer, 75413

Yuval Langer <yuval.langer@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#75413: Fix faulty example of SRFI-31 in the manual.
  2025-01-07  1:23 ` Rob Browning
@ 2025-01-09  4:01   ` Yuval Langer
  2025-01-09  4:11     ` Yuval Langer
  0 siblings, 1 reply; 5+ messages in thread
From: Yuval Langer @ 2025-01-09  4:01 UTC (permalink / raw)
  To: Rob Browning; +Cc: 75413

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

Adding a `(newline)` in this patch.

On Tue, Jan 7, 2025 at 3:23 AM Rob Browning <rlb@defaultvalue.org> wrote:
>
> Yuval Langer <yuval.langer@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

[-- Attachment #2: 0001-Fix-faulty-SRFI-31-example.patch --]
[-- Type: text/x-patch, Size: 925 bytes --]

From 98a81d3c91b61eed53b1b3d242c8d4f1508e84e7 Mon Sep 17 00:00:00 2001
From: Yuval Langer <yuvallangerontheroad@gmail.com>
Date: Fri, 3 Jan 2025 06:37:43 +0200
Subject: [PATCH] Fix faulty SRFI-31 example.

---
 doc/ref/srfi-modules.texi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
index d77bc1c90..85dbc2b96 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) (newline)
+                         (display-n item (- n 1)))))
   guile> (tmp 42 3)
   424242
   guile>
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#75413: Fix faulty example of SRFI-31 in the manual.
  2025-01-09  4:01   ` Yuval Langer
@ 2025-01-09  4:11     ` Yuval Langer
  0 siblings, 0 replies; 5+ messages in thread
From: Yuval Langer @ 2025-01-09  4:11 UTC (permalink / raw)
  To: Rob Browning; +Cc: 75413

[-- Attachment #1: Type: text/plain, Size: 1567 bytes --]

Sorry about the flood.  I have added `(newline)`, but the example
output did not have the literal newlines, so in this patch I have
added both the `(newline)` call and the example output newlines.


On Thu, Jan 9, 2025 at 6:01 AM Yuval Langer <yuval.langer@gmail.com> wrote:
>
> Adding a `(newline)` in this patch.
>
> On Tue, Jan 7, 2025 at 3:23 AM Rob Browning <rlb@defaultvalue.org> wrote:
> >
> > Yuval Langer <yuval.langer@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

[-- Attachment #2: 0001-Fix-faulty-SRFI-31-example.patch --]
[-- Type: text/x-patch, Size: 962 bytes --]

From 55b689307972cd705a1b315cd62125429112d4c8 Mon Sep 17 00:00:00 2001
From: Yuval Langer <yuvallangerontheroad@gmail.com>
Date: Fri, 3 Jan 2025 06:37:43 +0200
Subject: [PATCH] Fix faulty SRFI-31 example.

---
 doc/ref/srfi-modules.texi | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
index d77bc1c90..353867a82 100644
--- a/doc/ref/srfi-modules.texi
+++ b/doc/ref/srfi-modules.texi
@@ -3367,10 +3367,13 @@ 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) (newline)
+                         (display-n item (- n 1)))))
   guile> (tmp 42 3)
-  424242
+  42
+  42
+  42
   guile>
 @end lisp
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#75413: Fix faulty example of SRFI-31 in the manual.
  2025-01-06 23:54 bug#75413: Fix faulty example of SRFI-31 in the manual Yuval Langer
  2025-01-07  1:23 ` Rob Browning
@ 2025-01-20 19:58 ` lloda
  1 sibling, 0 replies; 5+ messages in thread
From: lloda @ 2025-01-20 19:58 UTC (permalink / raw)
  To: 75413-done


Patch applied in 0b501477f937718a89a2783409e5b9327a03f800.

Thanks






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-20 19:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-06 23:54 bug#75413: Fix faulty example of SRFI-31 in the manual Yuval Langer
2025-01-07  1:23 ` Rob Browning
2025-01-09  4:01   ` Yuval Langer
2025-01-09  4:11     ` Yuval Langer
2025-01-20 19:58 ` lloda

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