working on continuation mark stuff

This commit is contained in:
Danny Yoo 2011-04-13 17:06:29 -04:00
parent 4f2e6f8546
commit 53a9889822
4 changed files with 14 additions and 9 deletions

View File

@ -40,6 +40,8 @@
v]
[(vector? v)
v]
[(ContinuationMarkSet? v)
v]
[else
(error 'ensure-primitive-value "~s" v)])))
@ -80,7 +82,9 @@
(apply vector (map PrimitiveValue->racket (vector->list v)))]
[(MutablePair? v)
(cons (PrimitiveValue->racket (MutablePair-h v))
(PrimitiveValue->racket (MutablePair-t v)))]))
(PrimitiveValue->racket (MutablePair-t v)))]
[(ContinuationMarkSet? v)
v]))
(define (racket->PrimitiveValue v)

View File

@ -143,14 +143,14 @@
(cond
[(empty? frames)
empty]
[(eq? tag (frame-tag (first frames)))
empty]
[else
(append (hash-map (frame-marks (first frames))
cons)
(loop (rest frames)))])))])])
(make-primitive-proc (lambda args (apply f args))
'(1 2)
(if (eq? tag (frame-tag (first frames)))
empty
(loop (rest frames))))])))])])
(make-primitive-proc (lambda (machine . args) (apply f machine args))
'(0 1)
'current-continuation-marks)))

View File

@ -15,7 +15,8 @@
(Vectorof PrimitiveValue)
MutablePair
ContinuationMarkSet
)))
(define-type SlotValue (U PrimitiveValue
(Boxof PrimitiveValue)

View File

@ -1083,8 +1083,8 @@
(test '(with-continuation-mark 'name "danny"
(continuation-mark-set->list (current-continuation-marks)))
'("danny"))
(current-continuation-marks))
(make-ContinuationMarkSet (list (cons 'name "danny"))))
#;(test (read (open-input-file "tests/conform/program0.sch"))