fixed chaining of fieldselectors
[cc1516.git] / examples / passBy.spl
index 552eabe..d463ed1 100644 (file)
@@ -1,34 +1,10 @@
-//modify1(s) :: [Char] -> [Char] {
-//    //s.hd = 'a';
-//    s.tl = [];
-//    return s;
-//}//
-
-//modify2(c) :: Char -> Void {
-//    c = 'a';
-//}//
-
-//main() {
-//    var zs = "bar";
-//    var zc = 'b';
-//    var zss = modify1(zs);
-//    modify2(zc);//
-
-//    print("zs was bar, is now: ");
-//    print(zs);
-//    print(", m1 returned: ");
-//    print(zss);
-//    print("\n");
-//    print("zc was 'b', is now: ", zc, "\n");
-//}
-
-modi(t) :: (Int,Int) -> Void {
-    t.fst = 1;
+modif(str) :: [Char] -> Void {
+    str.tl.tl.hd = 'z';
 }
 
 main() {
-    var x = (2,3);
-    print(x.fst);
-    modi(x);
-    print(x.fst);
+    var s = "bar";
+    print(s, "\n");
+    modif(s);
+    print(s, "\n");
 }
\ No newline at end of file