Richard Haven (8) [Avatar] Offline
2.1.2 note 1: "You use the val keyword to declare a variable" No, one uses var for variables; val is for Kotlin immutable. This early example should introduce as few new concepts as possible

Loc 785: "The interface Expr has two subclasses, ..." Interfaces don't have subclasses; they have implementations

3.5: Validation: at least the later examples should show how to handle validation errors

4.2.3: "If you want to forbid to instantiate you class" Not actually english or understandable

Loc 2427 "... replace an argument with the default argument name it ..." Because it is a common word, please consider making these variables more typographically distinctive (bold, underline, etc.)

Loc 2579 fun Person.isAdult() = age > 21 Actually, it is >= 21

Loc 2736 the "any" and "all" and negation thereof. Please be clear and explain the difference between classical logical terms and how Kotlin uses "all" and "any". Classically, !any means none and !all can mean some or none (e.g. universal affirmatives may be only partially converted)

Loc 2898 Might "An interface with only one abstract method ..." also be called an event handler?

All the code samples should be left-justified, not full. It looks bad
Dmitry Jemerov (39) [Avatar] Offline
Hi Richard,

Thanks for your feedback! Replying to specific items:

1) Actually the only term we use for both "var" and "val" is "variable", even though it's true that "val" doesn't change. We'll look at this again and see if there's a better term that we can use.
2) Fixed
3) The proper way to handle validation errors depends heavily on the type of the application you're working on. It's not really possible to describe this in a general way.
4) Fixed
5) All identifiers, keywords and variable names, including 'it', are written in a monospace font, according to the standard convention in Manning books. 'it' is not the only identifier or keyword which looks like an English word, so I don't see why it would need to be specially emphasized.
6) Fixed, even though it doesn't really matter.
7) I think that a discussion of logic would make this passage more confusing, and not more clear.
smilie Some interfaces with one abstract method are event handlers; many others are not. Also, there are many event handler interfaces that have more than one abstract method (e.g. MouseListener).
9) All the formatting you see in the MEAP version of the book is preliminary. The final book will be produced through an entirely different process, with manual rather than automated typesetting, and will have proper formatting.
408399 (15) [Avatar] Offline
1) I strongly recommend "You use the val keyword to declare an immutable variable". I did take a wrong turn because it just says "a variable". They subsequent introduction of the var keyword caught me by surprise.

7) How do I find "loc 2736"? I'd like to examine this more closely.