mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Fix faulty SRFI-31 example.
This commit is contained in:
parent
bf3c632b82
commit
0b501477f9
1 changed files with 6 additions and 3 deletions
|
@ -3367,10 +3367,13 @@ The second syntax can be used to create anonymous recursive functions:
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
guile> (define tmp (rec (display-n item n)
|
guile> (define tmp (rec (display-n item n)
|
||||||
(if (positive? n)
|
(when (positive? n)
|
||||||
(begin (display n) (display-n (- n 1))))))
|
(display item) (newline)
|
||||||
|
(display-n item (- n 1)))))
|
||||||
guile> (tmp 42 3)
|
guile> (tmp 42 3)
|
||||||
424242
|
42
|
||||||
|
42
|
||||||
|
42
|
||||||
guile>
|
guile>
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue