From 5a9d30934588cb67206611a5d2dbc8dd36972bce Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 29 Dec 2018 00:07:33 -0500 Subject: sicp.org: Add notes for ex2.22. --- sicp.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sicp.org b/sicp.org index 879c2e4..54d4343 100644 --- a/sicp.org +++ b/sicp.org @@ -459,3 +459,15 @@ applicative order (gcd 2 0) 2 #+END_EXAMPLE +** 2 +*** 22 +#+BEGIN_SRC scheme +(cons ... (cons (cons LIST NUMBER²) NUMBER²) NUMBER²) +#+END_SRC + +creates a list with the squared numbers in a messy nested list like: + +#+BEGIN_SRC scheme +(square-list '(1 2 3 4 5)) +;; $3 = (((((() . 1) . 4) . 9) . 16) . 25) +#+END_SRC -- cgit v1.2.3