May 2010
2 posts
5 tags
ScalaCL uses Apache License (woot)
I was incredibly relieved to learn that the ScalaCL library ships under the Apache License and not the LGPL. This saves me immense headache. My guarded optimism for OpenCL on Scala is beginning to take on a life of its own.
5 tags
Simple list addition in Scala
Straightforward summation of List and Array values in Scala:
def addLists(list1: List[Int], list2: List[Int]) : List[Int] = {
if(list1 == Nil) list2
else if(list2 == Nil) list1
else ((list1 head) + (list2 head)) :: addLists((list1 tail), (list2 tail))
}
def addArrays(arr1: Array[Int], arr2: Array[Int]) : Array[Int] = {
require(arr1.length == arr2.length)
var i = 0
while(i <...