Check output device is a terminal: Difference between revisions

m
→‎{{header|OCaml}}: lighter syntax
(added ocaml)
m (→‎{{header|OCaml}}: lighter syntax)
Line 33:
 
<lang ocaml>let () =
print_endline begin(
if Unix.isatty Unix.stdout
then "Output goes to tty."
else "Output doesn't go to tty."
end)</lang>
 
Testing in interpreted mode: