- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: compiler and i disagree on a matter of typing...
Thu, 2010-05-20, 20:55
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:
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117
+1 206.650.3740
http://biosimilarity.blogspot.com
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