Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: eec8274059
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (36 sloc) 0.958 kb
open Common
open Osequence
(* growing array ? initialise with None,
* and generate exception when not defined or have an arraydefault
* update: can use dynArray ?
*)
(* !!take care!!, this is not a pure data structure *)
class ['a] oarray n el =
object(o: 'o)
inherit ['a] osequence
val data = Array.make n el
method empty = raise Todo
method add (i,v) =
Array.set data i v;
o
method iter f =
Array.iteri (curry f) data
method view = raise Todo
method assoc i =
Array.get data i
method null = raise Todo
method nth = raise Todo
method mem = raise Todo
method last = raise Todo
method first = raise Todo
method delkey = raise Todo
method keys = raise Todo
method del = raise Todo
method fromlist = raise Todo
method length =
Array.length data
(* method create: int -> 'a -> 'o =
raise Todo
*)
(* method put: make more explicit the fact that array do side effect *)
end
Jump to Line
Something went wrong with that request. Please try again.