CSE 130 - Programming Assignment #4 FAQ

  1. In 1a do we have to check if both parts of a binary expression is int?

  2. Yes. And raise a properly worded MLFailure exception otherwise.

  3. There is no specific constructor for Plus/Minus/Div other binary operations.

  4. Use the Bin constructor for all of those.

  5. Does the grader care about the exact text in MLFailure exceptions?.

  6. No. Put something reasonable/understandable.

  7. What does lookup do when it doesn't find a variable in the environment?.

  8. Raise a properly worded MLFailure exception.

  9. Do we have to ensure that the then and else branch of an if have the same type as in ocaml?

  10. Nope.

  11. Do we have to worry about the type of a list i.e. that all elements have the same type?

  12. Only if it is used in an ill-typed manner. For example let mixed = [1;false] is fine but (hd mixed) && true should throw an error.

  13. Do we have to worry about the arguments of map/fold?

  14. Again, only if it is used in an ill-typed manner. For example let badIfUsed = map true is fine because it is never used, even though map expects a function but boolean foo is not a function. However, badIfUsed [1] should throw an error.