manpagez: man pages & more
info guile-tut
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.0.3 Using recursion to process lists

Here are some typical examples of using recursion to process a list.

 
;; this is a rather trivial way of reversing a list
(define (my-reverse l)
  (if (null? l)
      l
      (append (my-reverse (cdr l)) (list (car l)))))
(my-reverse '(27 32 33 40))
⇒ (40 33 32 27)

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.