fork(2) download
  1. object Main extends App {
  2. def yoba(data: Any*) = data.collect {
  3. case str: String => s"String: $str"
  4. case int: Int => s"Integer: $int"
  5. case bool: Boolean => s"Boolean: $bool"
  6. }
  7.  
  8. yoba(123, "Yoba", false, 123).distinct.foreach(println)
  9. }
Success #stdin #stdout 0.43s 382016KB
stdin
Standard input is empty
stdout
Integer: 123
String: Yoba
Boolean: false