14 Jul 2002 14:25
Statically detecting arrays bound exceptions ?? (was: Universal Serializer)
Berke Durak <berke <at> altern.org>
2002-07-14 12:25:40 GMT
2002-07-14 12:25:40 GMT
On Fri, Jul 12, 2002 at 10:41:35PM +1000, John Max Skaller wrote:
[...]
> Ocaml run time errors include array (and string) bounds exceptions and
> infinite recursions:
> static type checking could detect the first, but not the second.
Hey, wait a minute, how do you plan to statically detect bounds exceptions ?
It's as undecidable as detecting infinite recursions.
let rec f () =
let a = [|1;2|] in
if compiler_is_gonna_say_that_there_is_gonna_be_a_bounds_error f then
a.(0)
else
a.(3)
--
--
Berke Durak
-------------------
To unsubscribe, mail caml-list-request <at> 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
RSS Feed