The following prints "now" and "is":
I wanted to recursively collect any's strings into a list, so i
generalized from the above and wrote:
The following compile error occurred:
found :
String
required: List[Any]
case s:String=> s :: recurs(a.tail)
^
I am not sure what this error message is telling me. It is the
basic question I am putting forward to this forum.
I corrected the compilation problem with the following; but I am unsure
as to why this worked:
Of course, I now get a runtime exception 'ExceptionInInitializerError'.
When the 'any' list is empty, then the execution of 'a.head'
throws the exception. Easily fixed.