List Info

Thread: "ocaml_beginners"::[] Re: how to create a closure?




"ocaml_beginners"::[] Re: how to create a closure?
user name
2006-12-11 01:00:11

I'm not sure what the LISP you gave means, but what it looks to me
what you're trying to do is

type myarray = None | Some of int array;;

let a = ref None;;

let get_array () =
match !a with
None ->
(
let array = Array.make 10 0 in
a := Some array;
!array
)
| Some array -> array;;

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )