mastering_nim
mastering_nim copied to clipboard
numeric literals
On page 51, chapter 12, the book has a numeric expression that looks something like -128
▯i8
(with a narrow vertical rectangle) instead of the intended expression -128'i8
.
The affected sentence (from the online documentation):
The rationale is that an expression -128'i8 should be valid and without this special case, this would be impossible -- 128 is not a valid int8 value, only -128 is.
Parenthetically, this sentence is a little bit puzzling when first read, because the reader has not yet been introduced to type suffixes (except in the syntax on p. 50) and so has to surmise that the suffix i8
makes the literal an int8
value.
numeric expression that looks something like -128▯i8 (with a narrow vertical rectangle)
Thanks for the report, this will be fixed in the next version of the book.