Published online by Cambridge University Press: 05 June 2012
This book includes a great many examples. These examples are presented as if they were typed on the keyboard of a computer during an interactive session in Caml. In consequence, they include lines written by the user along with responses from the system. The character # that appears at the beginning of examples is the system prompt. Text written by the user begins after that character and ends with a double semi-colon (;;). Everything between the # and the double semi-colon is thus due to the user. The rest is the system response. This system response includes information about type and value.
In the Caml system, the type of expressions entered by the user is computed statically, that is, computed before evaluation. Any possible inconsistencies in type are detected automatically and reported by an error message. This kind of type-checking is carried out without the user ever having to give any indication to the system about types—no type declarations as in other languages, like Pascal or C.
Once the types have been synthesized satisfactorily, evaluation takes place, and then a result is computed and displayed. This display takes one of two different forms, depending on whether the text entered by the user is a simple expression or a definition.
The examples given here differ a bit in typography from those that actually appear on screen during a real working session; we modified them for legibility and aesthetic reasons.
To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.