- Jul 2023
-
cs3110.github.io cs3110.github.io
-
The problem is that the OUnit library hasn’t been loaded into utop yet. It can be with the following directive
What's the difference between load and require directives?
"Load" uses .cmo files built from those of your directory. "Require" get them from libraries, is that right? But where from?
-
- May 2023
-
cs3110.github.io cs3110.github.io
-
(** [fact_aux n acc] is [n! * acc]. *)
Shouldn't the doc string be:
(* [fact_aux n acc] is [(n - 1)! * acc]. )
???
Given definition is valid for acc = 1, but for recursive cases where acc = (n - m)! the definition above seems clearer for me.
-
- Apr 2023
-
cs3110.github.io cs3110.github.io
-
solution to list max exn, above
See my comments for the question above.
-
list max exn string [★★] Write a function list_max_string
Perhaps the heading referred to a description similar to the body of this exercise, but where an exception was raised when the list is empty. Relates to my reversed observation in the following exercise.
-
but a function that says that January 100, 2013 comes after February 34, 2013 is also valid
Miswriting here? Perhaps the meaning was the respective tuples, (2013, 1, 100) and (2013, 2, 34) are valid (considering arbitrary date-like triples, without validation). As is seems a contradiction to previous statement: "because any date in January comes before any date in February".
-
- Mar 2023
-
cs3110.github.io cs3110.github.io
-
Let q1..qn be that subsequence of patterns (without the exception keyword), and let r1..rm be the subsequence of non-exception patterns
The indices ranges are swapped - it should be 1..m for try clause and 1..n for non exception patterns, using match clause.
-