Release coccinelle-0.1.1
[bpt/coccinelle.git] / commons / oarray.ml
CommitLineData
34e49164
C
1open Common
2
3open Osequence
4
5(* growing array ? initialise with None,
6 * and generate exception when not defined or have an arraydefault
7 * update: can use dynArray ?
8 *)
9
10(* !!take care!!, this is not a pure data structure *)
11class ['a] oarray n el =
12object(o: 'o)
13 inherit ['a] osequence
14
15 val data = Array.make n el
16
17 method empty = raise Todo
18 method add (i,v) =
19 Array.set data i v;
20 o
21
22 method iter f =
23 Array.iteri (curry f) data
24 method view = raise Todo
25
26 method assoc i =
27 Array.get data i
28
29 method null = raise Todo
30 method nth = raise Todo
31 method mem = raise Todo
32 method last = raise Todo
33 method first = raise Todo
34 method delkey = raise Todo
35 method del = raise Todo
36 method fromlist = raise Todo
37 method length =
38 Array.length data
39
40 (* method create: int -> 'a -> 'o =
41 raise Todo
42 *)
43 (* method put: make more explicit the fact that array do side effect *)
44end
45