diff --git a/book.tex b/book.tex index 0fa1b58..33eecbd 100644 --- a/book.tex +++ b/book.tex @@ -26,7 +26,7 @@ \def\racketEd{0} \def\pythonEd{1} -\def\edition{0} +\def\edition{1} % material that is specific to the Racket edition of the book \newcommand{\racket}[1]{{\if\edition\racketEd{#1}\fi}} @@ -14417,6 +14417,7 @@ \section{Challenge: Arrays} raise Exception('len expected a tuple, not ' + repr(tup_t)) case Subscript(tup, index, Load()): tup_ty = self.type_check_exp(tup, env) + tup.has_type = tup_ty index_ty = self.type_check_exp(index, env) self.check_type_equal(index_ty, IntType(), index) match tup_ty: @@ -14456,6 +14457,7 @@ \section{Challenge: Arrays} match ss[0]: case Assign([Subscript(tup, index, Store())], value): tup_t = self.type_check_exp(tup, env) + tup.has_type = tup_t value_t = self.type_check_exp(value, env) index_ty = self.type_check_exp(index, env) self.check_type_equal(index_ty, IntType(), index)