X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=examples%2Fexample.spl;h=03878105a38931fed317fa46dc91aff68c65aa51;hb=39f7799760a30737f57fb2b8ccdb15074ee9ac45;hp=0bf275e8856ba18c11c0295150a2762ac8d66523;hpb=9e1081469910f9b70a1ea713f431aadf385c52b7;p=cc1516.git diff --git a/examples/example.spl b/examples/example.spl index 0bf275e..0387810 100644 --- a/examples/example.spl +++ b/examples/example.spl @@ -30,12 +30,12 @@ main ( ) :: Void { var ok = True; while(n<20) { facN = facR (n); - if (facN != factl (n) || facn != facL (n)){ + if (facN != factl (n) || facN != facL (n)){ print (n : facN : facl (n) : facL (n): []); ok=False; } } - print(ok); + //print(ok); } // A list based factorial function @@ -67,12 +67,12 @@ reverse(list):: [t] -> [t] { abs(n)::Int->Int{if(n<0)return -n; else return n;} //swap the elements in a tuple -swap(tuple) :: (a, a) -> (a, a){ - var tmp = tuple.fst; - tuple.fst = tuple.snd; - tuple.snd = tmp; - return tuple; -} +//swap(tuple) :: (a, a) -> (a, a){ +// var tmp = tuple.fst; +// tuple.fst = tuple.snd; +// tuple.snd = tmp; +// return tuple; +//} //list append append(l1, l2) :: [t] -> [t] -> [t] {