Skip to content

Commit bc2fd20

Browse files
committed
Overhaul Hustle and Hoax and fix up based on langs changes.
1 parent 9140e39 commit bc2fd20

File tree

6 files changed

+1880
-516
lines changed

6 files changed

+1880
-516
lines changed

www/notes/evildoer.scrbl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -702,16 +702,12 @@ of @racket[interp/io]:
702702
@ex[
703703
(exec/io (parse '(write-byte (read-byte))) "z")]
704704

705-
Note that we still provide an @racket[exec] function that works for
706-
programs that don't do I/O:
705+
Note that we still provide an @racket[exec] function, but it
706+
assumes there is no input and it prints all output:
707707

708708
@ex[
709-
(exec (parse '(eof-object? #f)))]
710-
711-
But it will fail if executing a program that uses I/O:
712-
713-
@ex[
714-
(eval:error (exec (parse '(write-byte 97))))]
709+
(exec (parse '(eof-object? (read-byte))))
710+
(exec (parse '(write-byte 97)))]
715711

716712
We can now state the correctness property we want of the compiler:
717713

www/notes/fraud.scrbl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,10 +899,10 @@ domain of expressions to be just @bold{closed expressions}, i.e. those
899899
that have no unbound variables.
900900

901901
@bold{Compiler Correctness}: @emph{For all @racket[e] @math{∈}
902-
@tt{ClosedExpr}, @racket[i], @racket[o] @math{∈} @tt{String}, and @racket[v]
903-
@math{∈} @tt{Value}, if @racket[(interp/io e i)] equals @racket[(cons
904-
v o)], then @racket[(exec/io e i)] equals
905-
@racket[(cons v o)].}
902+
@tt{ClosedExpr}, @racket[i], @racket[o] @math{∈} @tt{String}, and @racket[A]
903+
@math{∈} @tt{Answer}, if @racket[(interp/io e i)] equals @racket[(cons
904+
a o)], then @racket[(exec/io e i)] equals
905+
@racket[(cons a o)].}
906906

907907
The check for correctness is the same as before, although the check should only be applied
908908
to elements of @tt{ClosedExpr}:

0 commit comments

Comments
 (0)