Essentials of Programming Languages Language
The Essentials of Programming Languages language in DrRacket
provides a subset of functions and syntactic forms of
racket—
#lang eopl | package: eopl |
The following bindings are re-provided from racket:
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
| |||
|
|
|
|
syntax
(define-datatype id predicate-id (variant-id (field-id predicate-expr) ...) ...)
Each variant-id is defined as a constructor function that creates an instance of the datatype; the constructor takes as many arguments as the variant’s field-ids, and each argument is checked by applying the function produced by the variant’s predicate-expr.
In DrScheme v209 and older, when constructor-based printing was used, variant instances were printed with a make- prefix before the variant name. Thus, for compatibility, in addition to variant-id, make-variant-id is also defined for each variant-id (to the same constructor as variant-id).
syntax
(cases datatype-id expr (variant-id (field-id ...) result-expr ...) ...)
(cases datatype-id expr (variant-id (field-id ...) result-expr ...) ... (else result-expr ...))
syntax
syntax
syntax
syntax
syntax
syntax
value
sllgen:make-rep-loop : procedure?
value
procedure
(eopl:printf form v ...) → void?
form : string? v : any/c
procedure
(eopl:pretty-print v [port]) → void?
v : any/c port : output-port? = (current-output-port)
procedure
pred : (any/c . -> . any) x : any/c
procedure
x : any/c
procedure
pred : (any/c . -> . boolean?)
value
empty : empty?
syntax
(time expr)
procedure
(collect-garbage) → void?
Tracing a function causes tail-calls in the original function to become non-tail calls.
syntax
(provide provide-spec ...)
The eopl library sets this variable to #f in the current namespace when it executes.
procedure
(install-eopl-exception-handler) → void?
The eopl library calls this function when it executes.
Bibliography
[EoPL] | “Essentials of Programming Languages, Third Edition,” MIT Press, 2008. http://www.eopl3.com/ |