
The eopl language is now racket-based rather than mzscheme-based. This test-suite, which was originally distributed on the book's web-site has been re-written in the new language. Changes include dropping all drscheme-init.scm and top.scm files. Remaining files were renamed to use the .rkt extension and edited to use the #lang syntax (instead of modulue). Require and provide forms were changed to reflect racket's syntax instead of mzscheme's (eg, only-in vs. only). Several occurrences of one-armed ifs were changed to use when and unless. All tests have been run successfully.
24 lines
635 B
Racket
Executable File
24 lines
635 B
Racket
Executable File
#lang eopl
|
|
|
|
(require "data-structures.rkt")
|
|
(provide init-nameless-env empty-nameless-env extend-nameless-env
|
|
apply-nameless-env)
|
|
|
|
;;;;;;;;;;;;;;;; initial environment ;;;;;;;;;;;;;;;;
|
|
|
|
;; init-env : () -> Nameless-env
|
|
|
|
;; (init-env) builds an environment in which i is bound to the
|
|
;; expressed value 1, v is bound to the expressed value 5, and x is
|
|
;; bound to the expressed value 10.
|
|
|
|
(define init-nameless-env
|
|
(lambda ()
|
|
(extend-nameless-env
|
|
(num-val 1) ; was i
|
|
(extend-nameless-env
|
|
(num-val 5) ; was v
|
|
(extend-nameless-env
|
|
(num-val 10) ; was x
|
|
(empty-nameless-env))))))
|