Source

newref / testref.ml

Full commit
let a = ref "old" in
(* Old syntax *)
Printf.printf "%s\n" !a;
Printf.printf "%s\n" !(a);
Printf.printf "%s\n" (!(a));
Printf.printf "%s\n" (!a);
Printf.printf "%s\n" ! a;
Printf.printf "%s\n" ! (a);
Printf.printf "%s\n" ( ! (a));
Printf.printf "%s\n" ( ! a);

a := "new";
(* New syntax *)
Printf.printf "%s\n" $a;
Printf.printf "%s\n" $(a);
Printf.printf "%s\n" ($(a));
Printf.printf "%s\n" ($a);
Printf.printf "%s\n" $ a;
Printf.printf "%s\n" $ (a);
Printf.printf "%s\n" ( $ (a));
Printf.printf "%s\n" ( $ a);