we're violating continuation marks for some reason.

This commit is contained in:
Danny Yoo 2012-02-13 23:49:54 -05:00
parent fa0864a465
commit 59dd18976f
4 changed files with 30 additions and 2 deletions

View File

@ -31,7 +31,8 @@
return '#<continuation-mark-set>';
};
ContinuationMarkSet.prototype.ref = function(key) {
ContinuationMarkSet.prototype.ref = function(key, promptTag) {
// FIXME: ref needs to watch the promptTag as well and capture up to it.
var i, j;
var result = [];
var kvlist;

View File

@ -2206,6 +2206,21 @@
return contMarks;
});
installPrimitiveProcedure(
'continuation-mark-set->list',
makeList(2, 3),
function(M) {
var marks = checkContinuationMarkSet(M, 'continuation-mark-set->list', 0);
var key = checkAny(M, 'continuation-mark-set->list', 1);
var promptTag;
if (M.a === 3) {
promptTag = checkContinuationPromptTag(M, 'current-continuation-marks', 2);
}
return marks.ref(key, promptTag);
});
installPrimitiveClosure(
'make-struct-type',
makeList(4, 5, 6, 7, 8, 9, 10, 11),

View File

@ -257,7 +257,8 @@
current-continuation-marks
continuation-mark-set->list
;; continuation-mark-set?
;; continuation-mark-set->list

View File

@ -0,0 +1,11 @@
#lang planet dyoo/whalesong
(define (puzzle n)
(if (= n 0)
(continuation-mark-set->list (current-continuation-marks) 'secret)
(with-continuation-mark 'secret
(* n (first (continuation-mark-set->list (current-continuation-marks) 'secret)))
(puzzle (sub1 n)))))
(with-continuation-mark 'secret 1
(puzzle 10))