;; DrScheme shrould be run using MzScheme language mode so that error ;; is defined. The details of using error are slightly different between ;; MIT Scheme and MzScheme, but most error messages should work. ;; Allow name nil to be used for the empty list. (define nil '()) ;; Some other constants with non-traditional names: (define true #t) (define false #f) ;; For stream programming section 3.5 ;; We use the R5RS define force and delay which are slightly ;; different from the force and delay defined in the book: ;; delay (aka make-promise) handles recursive forcing. (define the-empty-stream '()) (define stream-null? null?) (define stream-car car) (define (stream-cdr s) (force (cdr s))) (define-syntax cons-stream (syntax-rules () ((_ head tail) (cons head (delay tail)))))