updated
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Mon, 24 Nov 2014 00:42:04 +0000
changeset 311 6719e8d10a0d
parent 310 d384fe01d0e8
child 312 5cdb4d40eb80
updated
progs/defs.rec
progs/fun.scala
--- a/progs/defs.rec	Mon Nov 24 00:11:31 2014 +0000
+++ b/progs/defs.rec	Mon Nov 24 00:42:04 2014 +0000
@@ -65,12 +65,12 @@
 //fib(20)
 //(write(fact(5)) ; fact(6))
 //(write(1) ; 2)
-//ack(2, 3)
+ack(3, 12)   // for tail-rec test
 //stack_test(0)
 //(write (div(11, 3)); rem(11, 3))
 //gcd(54, 24)
 //is_prime(2)
-primes(1000000)
+//primes(1000000)
 //collatz(5000)
 //facT(6, 1)
 
--- a/progs/fun.scala	Mon Nov 24 00:11:31 2014 +0000
+++ b/progs/fun.scala	Mon Nov 24 00:42:04 2014 +0000
@@ -128,7 +128,6 @@
 val LPAREN: Rexp = "("
 val ALL = SYM | DIGIT | OP | " " | ":" | ";" | "\"" | "=" | "," | "(" | ")"
 val ALL2 = ALL | "\n"
-//val COMMENT2 = ("/*" ~ NOT(ALL.% ~ "*/" ~ ALL.%) ~ "*/")
 val COMMENT = ("/*" ~ ALL2.% ~ "*/") | ("//" ~ ALL.% ~ "\n")
 
 
@@ -232,8 +231,6 @@
   case Bop(_, a1, a2) => max_stack_exp(a1) + max_stack_exp(a2)
 }
 
-
-
 // Parser combinators
 abstract class Parser[I <% Seq[_], T] {
   def parse(ts: I): Set[(T, I)]
@@ -479,5 +476,5 @@
 
 
 //examples
-//compile_run("defs.rec")
-compile_run("fact.rec")
+compile_run("defs.rec")
+//compile_run("fact.rec")