Skip to content

Commit 43fe92a

Browse files
committed
Knock on schedule.
1 parent b75b81f commit 43fe92a

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

www/notes/knock.scrbl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
@(ev '(require rackunit a86))
2121
@(ev `(current-directory ,(path->string (build-path notes "knock"))))
2222
@(void (ev '(with-output-to-string (thunk (system "make runtime.o")))))
23+
@(ev '(current-objs '("runtime.o")))
2324
@(for-each (λ (f) (ev `(require (file ,f))))
2425
'("interp.rkt" "compile.rkt" "ast.rkt" "parse.rkt" "types.rkt" "unload-bits-asm.rkt"))
2526

@@ -672,6 +673,21 @@ expression:
672673
(Add rsp 8)))) ; pop the saved value being matched
673674
)
674675

676+
We can check that the compiler works for a complete example:
677+
678+
@ex[
679+
(define (run p)
680+
(unload/free (asm-interp (compile (parse p)))))
681+
682+
(run
683+
'[(define (length xs)
684+
(match xs
685+
['() 0]
686+
[(cons x xs) (add1 (length xs))]))
687+
(length (cons 7 (cons 8 (cons 9 '()))))])
688+
]
689+
690+
675691

676692
With these pieces in place, here's the complete compiler:
677693

www/schedule.scrbl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
(list @wk{11/9}
7777
@bold{@seclink["Midterm_2"]{M2}}
78-
@elem{(slack.)}
78+
@elem{@secref["Knock"]}
7979
@elem{No lecture (exam)})
8080

8181
(list @wk{11/16}

0 commit comments

Comments
 (0)