Examples
[cc1516.git] / examples / passBy.spl
index d463ed1..74acb29 100644 (file)
@@ -2,9 +2,17 @@ modif(str) :: [Char] -> Void {
     str.tl.tl.hd = 'z';
 }
 
+modifAtom(x) :: Int -> Void {
+    x = 4;
+}
+
 main() {
     var s = "bar";
-    print(s, "\n");
+    var y = 1;
+    print("before modif: ", s, "\n");
     modif(s);
-    print(s, "\n");
+    print("after modif: ",s, "\n");
+    print("before modifAtom: ", y, "\n");
+    modifAtom(y);
+    print("after modifAtom: ", y);
 }
\ No newline at end of file