I need something like this:
class Node (left : Node*, right : Node*)
I understand the ambiguity of this signature.
Is there a way around it better than the following?
class Node (left : Array[Node, right : Array[Node])
val n = new Node (Array(n1, n2), Array(n3))
Maybe some kind of separator like this?
val n = new Node (n1, n2, Sep, n3)
You can have multiple argument lists, each of which may have (or just be) one repeated-args parameter:
scala> def m1(ints: Int*)(strs: String*): Int = ints.length + strs.length
dm1: (ints: Int*)(strs: String*)Int
scala> m1(1, 2, 3)("one", "two", "three")
res0: Int = 6
I ran this in the Scala 2.8 REPL. I don't know a reason it wouldn't work in 2.7, offhand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With