-
Couldn't load subscription status.
- Fork 407
Fix CaseObjectHashCode script #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CaseObjectHashCode script #37
Conversation
|
Also, should we use Scala's hash code function val i1Boxed = java.lang.Integer.valueOf(1)
val d1Boxed = java.lang.Double.valueOf(1.0)
i1Boxed == d1Boxed // true
i1Boxed equals d1Boxed // false
i1Boxed.hashCode // 1
i1Boxed.## // 1
d1Boxed.hashCode // 1072693248
d1Boxed.## // 1In Scala's hash-based data structures, the method val mp = HashMap(d1Boxed -> 3, 1 -> 4)
// val mp: HashMap[Matchable, Int] = HashMap(1.0 -> 4)If |
|
I also created two errata reports through https://www.oreilly.com/catalog/errataunconfirmed.csp?isbn=0636920365686. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching these typos!
|
Apparently |
I mean, in the first paragraph of the section "Case Objects and hashCode", you write This sentence is correct, but do you think there can be a new footnote to mention val mp = HashMap(d1Boxed -> 3, 1 -> 4)
// val mp: HashMap[Matchable, Int] = HashMap(1.0 -> 4)If people don't know |
|
I'll consider a footnote that recommends reading the scaladoc for |
No description provided.