In Scala, Arrays are a lot more similar to other collections classes (like Vector). E.g.:
def sumIt(args:Int*) = { args.reduce((sum, n) => sum + n)}
Looks pretty similar to:
def sumIt(args:Vector) = { args.reduce((sum, n) => sum + n)}
No comments:
Post a Comment