| 1 |
\begin{camlexample}{toplevel} |
| 2 |
\begin{caml} |
| 3 |
\begin{camlinput} |
| 4 |
$\?$ [@@@warning "+A"];; |
| 5 |
\end{camlinput} |
| 6 |
\end{caml} |
| 7 |
\begin{caml} |
| 8 |
\begin{camlinput} |
| 9 |
$\?$ 1 + <<2.>> ;; |
| 10 |
\end{camlinput} |
| 11 |
\begin{camlerror} |
| 12 |
Error: The constant 2. has type float but an expression was expected of type |
| 13 |
int |
| 14 |
\end{camlerror} |
| 15 |
\end{caml} |
| 16 |
\begin{caml} |
| 17 |
\begin{camlinput} |
| 18 |
$\?$ let f <<x>> = () ;; |
| 19 |
\end{camlinput} |
| 20 |
\begin{camlwarn} |
| 21 |
Warning 27 [unused-var-strict]: unused variable x. |
| 22 |
|
| 23 |
val f : 'a -> unit = <fun> |
| 24 |
\end{camlwarn} |
| 25 |
\end{caml} |
| 26 |
\end{camlexample} |
| 27 |
|
| 28 |
\begin{camlexample}{toplevel} |
| 29 |
\begin{caml} |
| 30 |
\begin{camlinput} |
| 31 |
$\?$ Format.printf "Hello@."; |
| 32 |
print_endline "world";; |
| 33 |
\end{camlinput} |
| 34 |
\begin{camloutput} |
| 35 |
Hello |
| 36 |
world |
| 37 |
- : unit = () |
| 38 |
\end{camloutput} |
| 39 |
\end{caml} |
| 40 |
\end{camlexample} |