Browse thread
Compiler feature - useful or not?
[
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: | -- (:) |
| From: | Gerd Stolpmann <info@g...> |
| Subject: | Re: [Caml-list] Compiler feature - useful or not? |
Am Freitag, den 16.11.2007, 13:32 -0600 schrieb Fernando Alegre: > > > While exceptions are needed for I/O, no core expression should raise an > > > exception. > > > > compare = compare;; > > > > (though cf. SML equality types) > > > > Good code using permission_of_int (as with good code using int_of_string) > > would ensure that the int is valid before ever calling permission_of_int but > > the permission_of_int itself needs to be able to raise the exception to > > fulfil the contract of its type (int -> permission). > > Exactly. And that is the reason why, IMHO, we may never see such an > extension to OCaml language, since it is primarily a research language > for type checking. (And so run-time "usefulness", or hacks, are > secondary to the OCaml team.) Interesting opinion - as far as I can see there are lots of usefulness hacks in OCaml, and this makes OCaml different from SML. Think of the generic comparison function. Or that recursively defined lazy values may raise Lazy.Undefined. Similar for recursive modules. I also don't think OCaml is a research language for type checking, although such research is done. Other aspects of programming are considered as well. Gerd -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------