mardi 16 juin 2015

What is the workaround for OCaml: exception Invalid_argument("Random.int")?

I have this bit of code:

let rec random_list = function
  | 0 -> []
  | n -> ( Random.int max_int ) :: ( random_list (n-1) )

It compiles okay, but when I execute it, this error shows up:

exception Invalid_argument("Random.int")

What is the workaround for this issue ?




Aucun commentaire:

Enregistrer un commentaire