Code Examples
Snippets of SML code are most easily studied by entering them into a "top-level", also known as a read-eval-print loop. This is an interactive session that prints the inferred types of resulting or defined expressions. Many SML implementations provide an interactive top-level, including SML/NJ:
$ sml Standard ML of New Jersey v110.52 -Code can then be entered at the "-" prompt. For example, to calculate 1+2*3:
- 1 + 2 * 3; val it = 7 : intThe top-level infers the type of the expression to be "int" and gives the result "7".
Read more about this topic: Standard ML
Famous quotes containing the words code and/or examples:
“Hollywood keeps before its child audiences a string of glorified young heroes, everyone of whom is an unhesitating and violent Anarchist. His one answer to everything that annoys him or disparages his country or his parents or his young lady or his personal code of manly conduct is to give the offender a sock in the jaw.... My observation leads me to believe that it is not the virtuous people who are good at socking jaws.”
—George Bernard Shaw (18561950)
“There are many examples of women that have excelled in learning, and even in war, but this is no reason we should bring em all up to Latin and Greek or else military discipline, instead of needle-work and housewifry.”
—Bernard Mandeville (16701733)