Created
April 19, 2022 08:55
-
-
Save stedolan/64a08ec762bf74ff650e5b48ed92166f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type n = Z | S of n | |
let rec gen_locals (local_ n) depth _ = local_ | |
if depth = 0 | |
then | |
S n | |
else | |
let s = S n in | |
let m = gen_locals s (depth - 1) (ref 42) in | |
let _ = gen_locals m (depth - 1) (ref 42) in | |
S n | |
let () = | |
match gen_locals Z 20 (ref 42) with | |
| S Z -> print_endline "ok\n" | |
| _ -> assert false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment