In the lecture we looked at how to write and run little programs in the interpreter. For submission you will need to write the assignment in a separate file. Here is how.
Lets suppose that you want to submit a function called max3 : int * int * int -> int which calculates the maximum of three numbers. First you experiment in the interpreter until you are happy with your implementation. Suppose that this is the script of my attempts:
This script includes some erroneous attempts, the final correct definition and some testing. This is not what you are supposed to submit. You need to submit just the definition of the function. Note that if this definition uses other definitions they also need to be included, and so on.
In this case, you need to create a new file and write in it only the definition,
Note that the terminator ;; needs not to be included!
As a final check before you submit do the following steps:
Now you can submit your file!
It is important to go through this little test in order to ensure that you submit only the relevant definitions for assessment.