| www.delorie.com/gnu/docs/guile/guile-tut_9.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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)
|
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |