Merge remote-tracking branch 'origin/interpreter-refactor' into interpreter-refactor
Conflicts: mceval/dd-mceval.rkt
This commit is contained in:
commit
807fdbaeda
|
@ -10,27 +10,6 @@
|
||||||
|
|
||||||
;; This is a lightly modified version of ch4-mceval.scm to work in racket.
|
;; This is a lightly modified version of ch4-mceval.scm to work in racket.
|
||||||
|
|
||||||
;;;;METACIRCULAR EVALUATOR FROM CHAPTER 4 (SECTIONS 4.1.1-4.1.4) of
|
|
||||||
;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
|
|
||||||
|
|
||||||
;;;;Matches code in ch4.scm
|
|
||||||
|
|
||||||
;;;;This file can be loaded into Scheme as a whole.
|
|
||||||
;;;;Then you can initialize and start the evaluator by evaluating
|
|
||||||
;;;; the two commented-out lines at the end of the file (setting up the
|
|
||||||
;;;; global environment and starting the driver loop).
|
|
||||||
|
|
||||||
;;;;**WARNING: Don't load this file twice (or you'll lose the primitives
|
|
||||||
;;;; interface, due to renamings of apply).
|
|
||||||
|
|
||||||
;;;from section 4.1.4 -- must precede def of metacircular apply
|
|
||||||
;; Racket doesn't seem to like this. Instead rename the apply here to
|
|
||||||
;; mce-apply.
|
|
||||||
;;(define apply-in-underlying-scheme apply)
|
|
||||||
|
|
||||||
;;;SECTION 4.1.1
|
|
||||||
|
|
||||||
|
|
||||||
(define type-tag car)
|
(define type-tag car)
|
||||||
(define dispatch-table (make-dispatch-table))
|
(define dispatch-table (make-dispatch-table))
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
#lang sicp
|
#lang sicp
|
||||||
|
|
||||||
(#%require "table.rkt")
|
|
||||||
(#%provide make-dispatch-table
|
(#%provide make-dispatch-table
|
||||||
put!
|
put!
|
||||||
put-alist!
|
put-alist!
|
||||||
get)
|
get)
|
||||||
|
|
||||||
|
|
||||||
(define (assoc key records)
|
(define (assoc key records)
|
||||||
(cond ((null? records) false)
|
(cond ((null? records) false)
|
||||||
((equal? key (caar records)) (car records))
|
((equal? key (caar records)) (car records))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user