The Artima Developer Community
Sponsored Link

Programming in Scala Forum
2nd ed. Page 60 object diagram incorrect

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Louis Sayers

Posts: 1
Nickname: imlou
Registered: May, 2011

2nd ed. Page 60 object diagram incorrect Posted: May 27, 2011 5:10 AM
Reply to this message Reply
Advertisement
Hi,

I just wanted to bring attention to the object diagram on page 60. I'm fairly certain the first diagram is incorrect with both sum fields pointing to the same (0) object.

It made me think what would happen if the sum wasn't an Int, but was something like a List instead.

A quick look in the terminal shows acc.sum, and csa.sum have different labels (res0, and res1). Which is the behaviour I would expect.

Having the two sum fields pointing to the same object (0) is misleading I would think.


I'm enjoying the book so far,

Thanks,

Louis

Topic: Upgrade from first edition ebook Previous Topic   Next Topic Topic: Second Edition .mobi format

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use