This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: compiler and i disagree on a matter of typing...

No replies
Meredith Gregory
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Dear Jason, Martin,
Doh! i know i was being stupid somewhere... ;-)
Best wishes,
--greg

On Thu, May 20, 2010 at 12:19 PM, Jason Zaugg <jzaugg@gmail.com> wrote:
def asNumeric: BigInt = {
 val seed: (BigInt, Int) = (BigInt("0", 16), 0)
 val seq: Seq[String] = "".split("-")
 val tuple: (BigInt, Int) = (seed /: seq) {
   case ((total, shift), s) =>
     val sBI = BigInt(s, 16)
     (((sBI * BigInt(16).pow(shift)) + total), (s.length + shift))
 }
 tuple._1
}

-jason

On Thu, May 20, 2010 at 8:45 PM, Meredith Gregory
<lgreg.meredith@gmail.com> wrote:
> Dear Scalarazzi,
> i'm probably just cross-eyed, but the ( scala.2.8.RC2 ) compiler and i
> disagree on the typing of acc in the expression here. It complains that it
> is expecting BigInt, whereas i'm seeing a consistent use as a pair ( BigInt,
> Int ). Could someone uncross my eyes?
> Best wishes,
> --greg



--
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.com

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland