Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] out-of-bound array or string access
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alain Frisch <frisch@c...>
Subject: Re: [Caml-list] out-of-bound array or string access
On 10 Oct 2001, Johann Spies wrote:

> Why did "if Array.length Sys.argv  <> 4 then " not catch this?
>
> The code:
...
> let bedrag = float_of_string Sys.argv.(1);;
> let rentekoers = float_of_string Sys.argv.(2);;
> let jare = float_of_string Sys.argv.(3);;
>
> let main()  = if Array.length Sys.argv  <> 4 then
...


Toplevel phrases are executed in order, so the code want to access
Sys.argv.(1,2,3) before the test.


-- 
  Alain Frisch

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr