Skip to content

Instantly share code, notes, and snippets.

View dschobel's full-sized avatar

Daniel Schobel dschobel

View GitHub Profile
@dschobel
dschobel / gist:4015295
Created November 5, 2012 04:20
mergesort in scala
val r = new scala.util.Random()
val data = List.fill(10)(r.nextInt(100))
def msort(data: List[Int]): List[Int] = {
def merge(xs: List[Int], ys: List[Int]): List[Int] = (xs, ys) match {
case (List(), _) => ys
case (_, List()) => xs
case (x :: xs1, y :: ys1) => if (x < y) x :: merge(xs1, ys) else y :: merge(xs, ys1)
}
here is the full compile log: http://gist.github.com/266605
the relevant part is:
`check/crc32_x86.S:96:suffix or operands invalid for 'push'
check/crc32_x86.S:97:suffix or operands invalid for 'push'
check/crc32_x86.S:98:suffix or operands invalid for 'push'
check/crc32_x86.S:99:suffix or operands invalid for 'push'
check/crc32_x86.S:265:suffix or operands invalid for 'pop'
check/crc32_x86.S:266:suffix or operands invalid for 'pop'
$ brew install xz
==> Downloading http://tukaani.org/xz/xz-4.999.9beta.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/xz/4.999.9beta --disable-debug --disa
==> make install
Making install in src
Making install in liblzma
Making install in api
make[4]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/Cellar/xz/4.999.9beta/include" || ../../../build-aux/install-sh -c -d "/usr/local/Cellar/xz/4.999.9beta/include"