More functional way of writing this palindrome extractor?
It can be as simple as:

scala&gt; val str =  "I like racecars that go fast"
str: java.lang.String = I like racecars that go fast

scala&gt; for { i &lt;- 2 to str.size; s &lt;- str.sliding(i) if s == s.reverse} yield s
res5: scala.collection.immutable.IndexedSeq[String] = Vector(cec, aceca, racecar)