Commit 7ee0f3ef authored by Jim Newton's avatar Jim Newton

conversion to 2.13

parent e4b5271a
......@@ -21,16 +21,22 @@
package cl
import scala.annotation.{tailrec, unused}
object CLcompat {
def prog1[A,B](val1:A, code2: => B):A = {
code2 // eval for side effect
val1
}
def prog2[A,B,C](val1:A, val2:B, code2: => C):B = {
def prog2[A,B,C](@unused _unused : A, val2:B, code2: => C):B = {
code2 // eval for side effect
val2
}
@tailrec
def every[A, B](L1: List[A], L2: List[B])(f: (A, B) => Boolean): Boolean = {
(L1, L2) match {
case (a :: as, b :: bs) => f(a, b) && every(as, bs)(f)
......@@ -41,6 +47,7 @@ object CLcompat {
def merge[A](clauses1: List[A], clauses2: List[A], clauseLess:(A,A)=>Boolean): List[A] = {
// Merge two lists which are already in sorted order, according to clauseLess
// into a new list which is likewise in sorted order.
@tailrec
def loop(clauses1: List[A], clauses2: List[A], acc: List[A]): List[A] = {
(clauses1, clauses2) match {
case (Nil, Nil) => acc.reverse
......@@ -81,4 +88,9 @@ object CLcompat {
case nonLocalExit: NonLocalExit if nonLocalExit.ident eq body => nonLocalExit.data
}
}
def main(argv:Array[String]):Unit = {
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment