Implement till 2.76

This commit is contained in:
2020-11-17 13:33:55 -05:00
parent aedc20b585
commit c061a25798
8 changed files with 307 additions and 9 deletions

View File

@@ -34,3 +34,14 @@
(if (> low high)
nil
(cons low (enumerate-interval (+ low 1) high))))
; Put and get functions. We could have implemented this via a list of
; three-tuples, but I don't know how to create global variables yet so we just
; use this code from SO. Doesn't look too complicated.
; https://stackoverflow.com/questions/5499005/how-do-i-get-the-functions-put-and-get-in-sicp-scheme-exercise-2-78-and-on
(define *op-table* (make-hash-table))
(define (put op type proc)
(hash-table/put! *op-table* (list op type) proc))
(define (get op type)
(hash-table/get *op-table* (list op type) #f))