[ocaml] code

Viewer

  1.  
  2.      let x = ref 0;;
  3.      let f2 () =
  4.        print_endline (string_of_int !x);
  5.        x := !+ 1;
  6.        x := !+ 1;
  7.        !x;;
  8.  
  9.      let rec l1 () =
  10.        if !> 6 then 0 else begin print_endline ("l1: " ^ (string_of_int !x)); f2 () + l1 () end;;
  11.  
  12.     l1 ();;
  13.       

Editor

You can edit this paste and save as new:


File Description
  • code
  • Paste Code
  • 06 Dec-2021
  • 285 Bytes
You can Share it: