Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/smlnj-lib/Util/mono-dynamic-array-sig.sml
ViewVC logotype

Annotation of /sml/trunk/src/smlnj-lib/Util/mono-dynamic-array-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (view) (download)

1 : monnier 2 (* mono-dynamic-array-sig.sml
2 :     *
3 :     * COPYRIGHT (c) 1993 by AT&T Bell Laboratories. See COPYRIGHT file for details.
4 :     *
5 :     * Signature for unbounded arrays.
6 :     *
7 :     *)
8 :    
9 :     signature MONO_DYNAMIC_ARRAY =
10 :     sig
11 :     type elem
12 :     type array
13 :    
14 :     val array : (int * elem) -> array
15 :     (* array (sz, e) creates an unbounded array all of whose elements
16 :     * are initialized to e. sz (>= 0) is used as a
17 :     * hint of the potential range of indices. Raises Size if a
18 :     * negative hint is given.
19 :     *)
20 :    
21 :     val subArray : array * int * int -> array
22 :     (* subArray (a,lo,hi) creates a new array with the same default
23 :     * as a, and whose values in the range [0,hi-lo] are equal to
24 :     * the values in b in the range [lo, hi].
25 :     * Raises Size if lo > hi
26 :     *)
27 :    
28 :     val fromList : elem list * elem -> array
29 :     (* arrayoflist (l, v) creates an array using the list of values l
30 :     * plus the default value v.
31 :     *)
32 :    
33 :     val tabulate: int * (int -> elem) * elem -> array
34 :     (* tabulate (sz,fill,dflt) acts like Array.tabulate, plus
35 :     * stores default value dflt. Raises Size if sz < 0.
36 :     *)
37 :    
38 :     val default : array -> elem
39 :     (* default returns array's default value *)
40 :    
41 :     val sub : array * int -> elem
42 :     (* sub (a,idx) returns value of the array at index idx.
43 :     * If that value has not been set by update, it returns the default value.
44 :     * Raises Subscript if idx < 0
45 :     *)
46 :    
47 :     val update : array * int * elem -> unit
48 :     (* update (a,idx,v) sets the value at index idx of the array to v.
49 :     * Raises Subscript if idx < 0
50 :     *)
51 :    
52 :     val bound : array -> int
53 :     (* bound returns an upper bound on the index of values that have been
54 :     * changed.
55 :     *)
56 :    
57 :     val truncate : array * int -> unit
58 :     (* truncate (a,sz) makes every entry with index > sz the default value *)
59 :    
60 :     (** what about iterators??? **)
61 :    
62 :     end (* MONO_DYNAMIC_ARRAY *)
63 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0