update'
[cc1516.git] / examples / higher.spl
index 3e923d7..c5bac9e 100644 (file)
@@ -34,10 +34,18 @@ intList(x){
        }
 }
 
+plus(x, y){
+       return x + y;
+}
+
 main(){
     var x = 5;
-       print("faculty of 5 is: ", foldr(\x y->x*y, 1, intList(5)));
-       print("sum of 1..5 is: ", foldr(\x y->x+y, 0, intList(5)));
-       print("sum of 0..12 but only the evens: ",
-               foldr(\x y->x+y, 0, filter(\x->x%2 == 0, intList(12))));
+
+       var a = plus(3);
+       print("3+5=", a(5));
+
+//     print("faculty of 5 is: ", foldr(\x y->x*y, 1, intList(5)));
+//     print("sum of 1..5 is: ", foldr(\x y->x+y, 0, intList(5)));
+//     print("sum of 0..12 but only the evens: ",
+//             foldr(\x y->x+y, 0, filter(\x->x%2 == 0, intList(12))));
 }