fixing the base (untraced) language

This commit is contained in:
Danny Yoo 2011-08-30 02:10:03 -04:00
parent ebc8919614
commit 302d046165
19 changed files with 33 additions and 21 deletions

View File

@ -6,4 +6,4 @@
`(file ,(path->string base-lang-path))) `(file ,(path->string base-lang-path)))
(require racket/runtime-path) (require racket/runtime-path)
(define-runtime-path base-lang-path "../lang/base.rkt") (define-runtime-path base-lang-path "../../lang/base.rkt")

View File

@ -140,7 +140,7 @@ EOF
(assemble-oparg (UnspliceRestFromStack!-length op)))] (assemble-oparg (UnspliceRestFromStack!-length op)))]
[(InstallContinuationMarkEntry!? op) [(InstallContinuationMarkEntry!? op)
(string-append "RUNTIME.installContinuationMarkEntry(MACHINE," (string-append "MACHINE.installContinuationMarkEntry("
"MACHINE.control[MACHINE.control.length-1].pendingContinuationMarkKey," "MACHINE.control[MACHINE.control.length-1].pendingContinuationMarkKey,"
"MACHINE.val);")] "MACHINE.val);")]

View File

@ -341,6 +341,20 @@
}; };
// Save the continuation mark on the top control frame.
Machine.prototype.installContinuationMarkEntry = function(key, value) {
var frame = this.control[this.control.length - 1];
var marks = frame.marks;
var i;
for (i = 0; i < marks.length; i++) {
if (equals(key, marks[i][0])) {
marks[i][1] = value;
return;
}
}
marks.push([key, value]);
};

View File

@ -7,7 +7,5 @@
;; If you don't want this, write in whalesong/base instead. ;; If you don't want this, write in whalesong/base instead.
(provide (except-out (all-from-out "base.rkt") (provide (except-out (all-from-out "base.rkt")
;;#%app #%app)
) (rename-out [traced-app #%app]))
;;(rename-out [traced-app #%app])
)

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(boolean? "t") (boolean? "t")
(boolean? #t) (boolean? #t)

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(require (planet dyoo/whalesong/image)) (require (planet dyoo/whalesong/image))
(color 3 4 5 0) (color 3 4 5 0)

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(let () (let ()
;; (define (caar l) ;; (define (caar l)

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(begin (begin
(define make-parser (define make-parser
(lambda (grammar lexer) (lambda (grammar lexer)

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(displayln "hello world") (displayln "hello world")

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(require (planet dyoo/whalesong/image)) (require (planet dyoo/whalesong/image))
(image-color? "red") (image-color? "red")

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
'(1 2 3) '(1 2 3)
(list "hello" "world") (list "hello" "world")

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
;; Knuth's Man-or-boy-test. ;; Knuth's Man-or-boy-test.
;; http://rosettacode.org/wiki/Man_or_boy_test ;; http://rosettacode.org/wiki/Man_or_boy_test

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(number? 0) (number? 0)

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(apply + 2 3 4 5 '()) (apply + 2 3 4 5 '())
(apply + 2 3 4 '(5)) (apply + 2 3 4 '(5))

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(provide (all-defined-out)) (provide (all-defined-out))

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(define-struct pair (f r)) (define-struct pair (f r))
(define-struct color (r g b)) (define-struct color (r g b))

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(define (make-gen gen) (define (make-gen gen)
(let ([cont (box #f)]) (let ([cont (box #f)])
(lambda () (lambda ()

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(define (make-gen gen) (define (make-gen gen)
(let ([cont #f]) (let ([cont #f])
(lambda () (lambda ()

View File

@ -1,4 +1,4 @@
#lang planet dyoo/whalesong #lang planet dyoo/whalesong/base
(substring "hello world" 0) (substring "hello world" 0)
(substring "hello world" 1) (substring "hello world" 1)