Skip to content

Commit

Permalink
Changed the representation of an oc to put the symbolic representatio…
Browse files Browse the repository at this point in the history
…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
calvis committed Apr 25, 2012
1 parent 152503e commit 8d77f28
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions ck.scm
Expand Up @@ -133,13 +133,13 @@
(define-syntax build-oc-aux (define-syntax build-oc-aux
(syntax-rules () (syntax-rules ()
((_ op () (z ...) (arg ...)) ((_ op () (z ...) (arg ...))
(let ((z arg) ...) `(,(op z ...) . (op ,z ...)))) (let ((z arg) ...) `((op ,z ...) . ,(op z ...))))
((_ op (arg0 arg ...) (z ...) args) ((_ op (arg0 arg ...) (z ...) args)
(build-oc-aux op (arg ...) (z ... q) args)))) (build-oc-aux op (arg ...) (z ... q) args))))


(define oc->proc car) (define oc->proc cdr)
(define oc->rands cddr) (define oc->rands cdar)
(define oc->rator cadr) (define oc->rator caar)


;; ---FIXED-POINT-------------------------------------------------- ;; ---FIXED-POINT--------------------------------------------------


Expand Down
2 changes: 1 addition & 1 deletion never-true.scm
Expand Up @@ -53,7 +53,7 @@
(define reified-allowed (define reified-allowed
(lambda (v r c) (lambda (v r c)
(let ((c (filter (lambda (oc) (eq? (oc->rator oc) 'allowed-c)) 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)))))) `((allowed . ,c))))))


(extend-enforce-fns 'required required-enforceo) (extend-enforce-fns 'required required-enforceo)
Expand Down
4 changes: 2 additions & 2 deletions pref.scm
Expand Up @@ -49,9 +49,9 @@
(else (loop (cdr c^)))))))))) (else (loop (cdr c^))))))))))
(loop (loop
(map (map
;; This is lazy
(lambda (oc) (lambda (oc)
(cons (caddr oc) (cadddr oc))) (let ((p (oc->rands oc)))
(cons (car p) (cadr p))))
(filter (filter
(lambda (oc) (eq? (oc->rator oc) 'prefo-c)) (lambda (oc) (eq? (oc->rator oc) 'prefo-c))
c)))) c))))
Expand Down

0 comments on commit 8d77f28

Please sign in to comment.