Permalink
Browse files

Changed the representation of an oc to put the symbolic representatio…

…n first, then the closure. Also fixed all the places where this caused an error due to representation-leaking lazyness on my part!
  • Loading branch information...
1 parent 152503e commit 8d77f2889e3a083a8c936b2aa95908adb96d9745 @calvis committed Apr 25, 2012
Showing with 7 additions and 7 deletions.
  1. +4 −4 ck.scm
  2. +1 −1 never-true.scm
  3. +2 −2 pref.scm
View
8 ck.scm
@@ -133,13 +133,13 @@
(define-syntax build-oc-aux
(syntax-rules ()
((_ op () (z ...) (arg ...))
- (let ((z arg) ...) `(,(op z ...) . (op ,z ...))))
+ (let ((z arg) ...) `((op ,z ...) . ,(op z ...))))
((_ op (arg0 arg ...) (z ...) args)
(build-oc-aux op (arg ...) (z ... q) args))))
-(define oc->proc car)
-(define oc->rands cddr)
-(define oc->rator cadr)
+(define oc->proc cdr)
+(define oc->rands cdar)
+(define oc->rator caar)
;; ---FIXED-POINT--------------------------------------------------
View
@@ -53,7 +53,7 @@
(define reified-allowed
(lambda (v r c)
(let ((c (filter (lambda (oc) (eq? (oc->rator oc) 'allowed-c)) c)))
- (let ((c (walk* (map cddr c) r)))
+ (let ((c (walk* (map oc->rands c) r)))
`((allowed . ,c))))))
(extend-enforce-fns 'required required-enforceo)
View
@@ -49,9 +49,9 @@
(else (loop (cdr c^))))))))))
(loop
(map
- ;; This is lazy
(lambda (oc)
- (cons (caddr oc) (cadddr oc)))
+ (let ((p (oc->rands oc)))
+ (cons (car p) (cadr p))))
(filter
(lambda (oc) (eq? (oc->rator oc) 'prefo-c))
c))))

0 comments on commit 8d77f28

Please sign in to comment.