Title here
Summary here
Standard ML (SML) has various value types including strings, integers, floats, booleans, etc. Here are a few basic examples.
To run this program, save it in a file (e.g., values.sml
) and use an SML interpreter or compiler. For example, if you’re using the Standard ML of New Jersey (SML/NJ) system:
In this Standard ML code:
^
for string concatenation.Int.toString
and Real.toString
to convert numbers to strings for printing.andalso
, orelse
, and not
.val _ = ...
to execute expressions for their side effects (printing) without binding the result to a name.(* ... *)
for comments.Note that SML is a functional language, so this example doesn’t follow the imperative style of the original code. Instead, it demonstrates equivalent operations using SML’s syntax and standard library functions.