CS 451 Programming Paradigms
ML Assignment One: RPN Calculator

Your assignment is to create the same RPN calulator that you did in the first assignment in LISP only this time do it in ML. You should take your input from a file and write your output to a file. You can write a loop that allows the input file to have multiple lines, each of which is a separate input to the program. The end-of-file character would terminate such a loop. As in the LISP assignment you should produce either an infix or prefix expression for the input postfix expression, in addition to the result of its evaluation.

As before, handling errors is expected, and you only have to do binary +, -, and * as operators. This baseline will start you at a 'B'.

For better grades try to tackle other operators, do extremely good error checking, provide a nice interface, etc. In this particular problem you can look for features of ML that allow a very concise and elegant solution to be written. Think recursion and pattern matching. This assignment is due in class on paper with tests.


[ Back to CS451: The ML Segment ]