Browse thread
[Caml-list] Why must types be always defined at the top level?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2004-06-24 (14:27) |
From: | John Hughes <jfh@c...> |
Subject: | RE: [Caml-list] Why must types be always defined at the top level? |
As I revise my course notes from SML/NJ to OCaml, I find myself asking some design questions --- "Why did they do it THIS way?". I should probably ask "Why is this way the right way to do it, regardless of the original motivation?," but let's assume the answers are the same. 1. Why no eqtypes? The idea of having the type-checker verify that you weren't doing equality testing on non-equality-testable types seemed like GOOD thing in SML, and I was surprised to see it gone. 2. Why no "end" on "let" expressions, i.e., let a = 3 and b = 2 in a + b;; rather than let a = 3 and b = 2 in a + b end; ? 3. Why semicolons for separating list items, so that [2,3] is interpreted as [(2,3)] ? 4. Why expose the hardware with float (and make it have equality testing) rather than continue with "real" (which was not an eqtype, if I recally correctly)? ------------ I'm sure these were all good decisions, but I'd like to better understand them. -John Hughes ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners