diff -r bc0e0aa4dee1 -r 3cbe3d90b77f progs/lecture3.scala --- a/progs/lecture3.scala Thu Dec 01 12:19:52 2016 +0000 +++ b/progs/lecture3.scala Thu Dec 01 13:50:36 2016 +0000 @@ -116,9 +116,17 @@ searchT(111, junk_coins, start_acc) searchT(111111, junk_coins, start_acc) -// moral: whenever a recursive function is resource-critical -// (i.e. works on large recursion depth), then you need to -// write it in tail-recursive fashion +// Moral: Whenever a recursive function is resource-critical +// (i.e. works with large recursion depths), then you need to +// write it in tail-recursive fashion. +// +// Unfortuantely, the Scala is because of current limitations in +// the JVM not as clever as other functional languages. It can +// only optimise "self-tail calls". This excludes the cases of +// multiple functions making tail calls to each other. Well, +// nothing is perfect. + + // Polymorphic Types