scala/recs.scala
changeset 198 d93cc4295306
parent 195 f06aa4e1c25b
child 200 8dde2e46c69d
--- a/scala/recs.scala	Tue Feb 26 12:47:03 2013 +0000
+++ b/scala/recs.scala	Tue Feb 26 13:24:40 2013 +0000
@@ -9,21 +9,21 @@
 case object Z extends Rec {
   override def eval(ns: List[Int]) = ns match {
     case n::Nil => 0
-    case _ => throw new IllegalArgumentException("Z: args")
+    case _ => throw new IllegalArgumentException("Z args: " + ns)
   }
 } 
 
 case object S extends Rec {
   override def eval(ns: List[Int]) = ns match {
     case n::Nil => n + 1
-    case _ => throw new IllegalArgumentException("S: args")
+    case _ => throw new IllegalArgumentException("S args: " + ns)
   }
 } 
 
 case class Id(n: Int, m: Int) extends Rec {
   override def eval(ns: List[Int]) = 
     if (ns.length == n && m < n) ns(m)
-    else throw new IllegalArgumentException("Id: args")
+    else throw new IllegalArgumentException("Id args: " + ns + "," + n + "," + m)
 }
 
 case class Cn(n: Int, f: Rec, gs: List[Rec]) extends Rec {