summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2020-11-09 03:48:14 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2020-11-09 03:48:14 +0900
commitcb567b766dc4381e450ae9618b099636599fe3d6 (patch)
treefd2bb37de9cee2776fe24cc171316b953705c6e2
parentea52d03d9a5e54d67534e911254127df7e5b8f54 (diff)
wip12
-rw-r--r--vikalpa.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/vikalpa.scm b/vikalpa.scm
index 49f6477..e610b80 100644
--- a/vikalpa.scm
+++ b/vikalpa.scm
@@ -729,7 +729,7 @@
(define-function app (x y)
(if (atom? x)
y
- (cons x (app (cdr x) y))))
+ (cons (car x) (app (cdr x) y))))
(define-theorem associate-app (x y z)
(equal? (app (app x y) z)
@@ -744,3 +744,8 @@
(define (atom? x)
(not (pair? x)))
+
+(define (app x y)
+ (if (atom? x)
+ y
+ (cons (car x) (app (cdr x) y))))