The Artima Developer Community
Sponsored Link

Programming in Scala Forum
Error in Chapter 6: p119

1 reply on 1 page. Most recent reply: Jan 27, 2008 1:03 PM by Scott Askew

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 1 reply on 1 page
Carsten Eckelmann

Posts: 6
Nickname: careck
Registered: Jun, 2003

Error in Chapter 6: p119 Posted: Dec 27, 2007 2:56 PM
Reply to this message Reply
Advertisement
the first time the gcd method is introduced in Rationale it is called with wrong parameters:

Class Rationale(n: Int, d: Int) {
private def gcd(..): Int = ...
private val g = gcd(x,y)
...
}

x and y have not been declared and probably should be n and d.

Cheers,
Carsten.


Scott Askew

Posts: 1
Nickname: 53713
Registered: Jan, 2008

Re: Error in Chapter 6: p119 Posted: Jan 27, 2008 1:03 PM
Reply to this message Reply
Indeed. I just caught the same thing and gcd(n, d) did the trick.

Flat View: This topic has 1 reply on 1 page
Topic: chapter 4, companion objects Previous Topic   Next Topic Topic: Scala IO (and printf)

Sponsored Links



Google
  Web Artima.com   

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