List Info

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




"ocaml_beginners"::[] Re: how to create a closure?
user name
2006-12-11 03:42:10

It's also easy to do it without defining any new type:

let a = ref [||];;

let get_array () =
match !a with
[||] ->
(
a := Array.make 10 0;
!a
)
| _ -> !a;;

__._,_.___
.

__,_._,___
[1]

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