fun h(a: Array<String>, collect:String = "") =
      a match {
        case [] -> collect
        case [x ~ xs] ->
            if(x == "Clear") h(xs)
            else h(xs,  collect ++ x)
      }
---
h([])