summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Tang <i@null.tl>2015-09-09 15:26:13 +0800
committerWei Tang <i@null.tl>2015-09-09 15:26:13 +0800
commit970d4647959f98c418491d228b601e9476ae0d9e (patch)
treed3d2b4a164a79d781727d8d2a752c30d7d9656af
parenta72b5f8a7fdd661655d9ba88b161a20a57966922 (diff)
downloadmm-970d4647959f98c418491d228b601e9476ae0d9e.tar.gz
mm-970d4647959f98c418491d228b601e9476ae0d9e.tar.bz2
fix apply-valueo: now handle lists
-rw-r--r--mm.rkt12
1 files changed, 11 insertions, 1 deletions
diff --git a/mm.rkt b/mm.rkt
index 95fd3e9..f93cd93 100644
--- a/mm.rkt
+++ b/mm.rkt
@@ -236,7 +236,17 @@
((paramo value)
(lookup-failbacko value params out))
((not-paramo value)
- (== value out)))))
+ (conde
+ ((== '() value))
+ ((symbolo value))
+ ((numbero value)))
+ (== value out))
+ ((not-paramo value)
+ (fresh (f r outf outr)
+ (== `(,f . ,r) value)
+ (apply-valueo f params outf)
+ (apply-valueo r params outr)
+ (== `(,outf . ,outr) out))))))
(check-expect
(run* (q) (apply-valueo '(param x) '(((param x) (variable x))) q))