English
Summary
Conclusions
Operator conventions make your own type natural in expressions, as long as the symbol keeps its expected semantics. Delegates separate out repetitive access logic, and interface delegation supports composition. For every mechanism, what matters is the moment of execution, the owner of the state, and a verified contract.
Self-check questions
- Why does operator not let you invent a new symbol?
- How does plusAssign differ from plus with assignment?
- Why does compareTo==0 not always mean equals?
- On which object is contains called for
x in a? - Which methods are needed to iterate over a range repeatedly?
- What do getValue and setValue receive?
- When does lazy call the initializer again?
- How does the moment of observable differ from that of vetoable?
- What is provideDelegate for?
- Why does an internal call of the delegate bypass the wrapper's override?