package pfff

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file oarray.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 (Common2.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

OCaml

Innovation. Community. Security.