altos/lambdakey-v1.0: shrink scheme code to fit the ROM
authorKeith Packard <keithp@keithp.com>
Fri, 15 Dec 2017 07:09:02 +0000 (23:09 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 15 Dec 2017 07:09:02 +0000 (23:09 -0800)
scheme has grown a bit; adapt

Signed-off-by: Keith Packard <keithp@keithp.com>
src/lambdakey-v1.0/ao_lambdakey_const.scheme

index d0c0e57895d54c883ddbd82f8507bee22b7b5076..503732723e7088880858e80a8a1956a1af98f423 100644 (file)
 
 (define (cdar l) (cdr (car l)))
 
-(define (caddr l) (car (cdr (cdr l))))
-
                                        ; (if <condition> <if-true>)
                                        ; (if <condition> <if-true> <if-false)
 
 (define (list-tail a b)
   (if (zero? b)
       a
-    (list-tail (cdr a (- b 1)))
-    )
+      (list-tail (cdr a) (- b 1))
+      )
   )
 
 (define (list-ref a b)
   (car (list-tail a b))
   )
 
-(define (list-tail a b)
-  (if (zero? b)
-      a
-    (list-tail (cdr a) (- b 1))))
-
-(list-tail '(1 2 3) 2)
-
-(define (list-ref a b) (car (list-tail a b)))
-
 (list-ref '(1 2 3) 2)
     
 
 
 (define string (lambda a (list->string a)))
 
-(display "apply\n")
-(apply cons '(a b))
-
 (define map
   (lambda (a . b)
         (define (args b)
 
 (map cadr '((a b) (d e) (g h)))
 
-(define for-each (lambda (a . b)
-                       (apply map a b)
-                       #t))
-
-(for-each display '("hello" " " "world" "\n"))
-
 (define (newline) (write-char #\newline))
 
 (newline)