Jelajahi Sumber

(read) is of type Integer

Ryan Scott 8 tahun lalu
induk
melakukan
7f286df47a
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      book.tex

+ 3 - 2
book.tex

@@ -3126,9 +3126,10 @@ association list.
      (lambda (e)
        (define recur (typecheck-R2 env e))
        (match e
-         [(? fixnum?) 'Integer]
+         [(? fixnum?)  'Integer]
          [(? boolean?) 'Boolean]
-         [(? symbol?) (lookup e env)]
+         [(? symbol?)  (lookup e env)]
+         [`(read)      'Integer]
          [`(let ([,x ,(app recur T)]) ,body)
           (define new-env (cons (cons x T) env))
           (typecheck-R2 new-env body)]