sicp

sicp sandbox.
git clone git://git.ricketyspace.net/sicp.git
Log | Files | Refs

commit 197c46b80ec621938fbac8e3926fa2efb83aa07f
parent 73ef53b87b5756e9fcb45f5c2851431a7c8d1422
Author: rsiddharth <s@ricketyspace.net>
Date:   Fri, 16 Nov 2018 20:17:31 -0500

Add (net ricketyspace sicp two eighteen).

Diffstat:
net/ricketyspace/sicp/two/eighteen.scm | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/net/ricketyspace/sicp/two/eighteen.scm b/net/ricketyspace/sicp/two/eighteen.scm @@ -0,0 +1,14 @@ +;;;; License: CC0-1.0 + +(define-module (net ricketyspace sicp two eighteen) + #:use-module (net ricketyspace sicp two seventeen) + #:export (sicp-reverse)) + +(define (sicp-append list1 list2) + (if (null? list1) + list2 + (cons (car list1) (sicp-append (cdr list1) list2)))) + +(define (sicp-reverse items) + (cond ((null? items) '()) + (else (sicp-append (sicp-reverse (cdr items)) (list (car items))))))