Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def withBufferedWriter(file: File)(block: BufferedWriter -> Unit)
- withBufferedWriter(new File("myfile.txt")) { out =>
- out write "whatever"
- ...
- }
- scala> def foo(as: Int*)(bs: Int*)(cs: Int*) = as.sum * bs.sum * cs.sum
- foo: (as: Int*)(bs: Int*)(cs: Int*)Int
- scala> foo(1, 2, 3)(4, 5, 6, 7, 9)(10, 11)
- res7: Int = 3906
- (A, B, C, D, E) => F
- ((A, B), (C, D, E)) => F
- (A, B) => (C, D, E) => F
- scala> def foo(a:Int, b:Int)(c:Int, d:Int, e:Int):Int = 9
- foo: (a: Int,b: Int)(c: Int,d: Int,e: Int)Int
- scala> foo _
- res4: (Int, Int) => (Int, Int, Int) => Int = <function2>
- def foo[T](a: T, b: T)(op: (T,T)=>T) = op(a,b)
- foo(1,2){_+_}
Add Comment
Please, Sign In to add comment