Untitled

 avatar
unknown
plain_text
3 years ago
273 B
2
Indexable

     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 ();;
      
Editor is loading...