Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
273 B
1
Indexable
Never

     let x = ref 0;;
     let f2 () =
       print_endline (string_of_int !x);
       x := !x + 1;
       x := !x + 1;
       !x;;

     let rec l1 () =
       if !x > 6 then 0 else begin print_endline ("l1: " ^ (string_of_int !x)); f2 () + l1 () end;;

    l1 ();;