... despite it being tail-call-optimizable?
def areStreamsEqual(stream1: InputStream, stream2: InputStream): Boolean =
{
val one = stream1.read()
val two = stream2.read()
if(one != two)
false
else if(one == -1 && two == -1)
true
else
areStreamsEqual(stream1, stream2)
}
Is there anyway to force the Scala compiler to do a tail call optimization here?