Running the following code:
let input_bool () = input_char stdin = 't' let () = if let x = input_bool () in let y = input_bool () in x || y then print_endline "yes"
At runtime I am prompted only for a single char and, when entering
t, the output
yes is immediately printed. Can anyone explain why the second call to
input_bool () is not happening?
EDIT: the same behaviour on changing the
&&, so I assume it’s not explained by the compiler doing some fancy inlining.