progs/lecture3.scala
changeset 77 3cbe3d90b77f
parent 73 5e4696ebd8dc
child 152 114a89518aea
--- 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