File: ARRAYED_COLLECTION.html

package info (click to toggle)
lisaac 1%3A0.13.1-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 15,232 kB
  • ctags: 6,386
  • sloc: ansic: 242,479; xml: 635; lisp: 333; makefile: 119; sh: 73; asm: 38
file content (116 lines) | stat: -rwxr-xr-x 8,377 bytes parent folder | download | duplicates (2)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE HTML SYSTEM>
<!-- Generated by Lisaac shorter / html style -->
<html>
<head>
<title>
Lisaac prototype interface
</title>
</head>
<body BGCOLOR="#FFFFFF">

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Header</font></strong>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">name</font></strong>    := <a href="ARRAYED_COLLECTION.html"><font color="#008000">ARRAYED_COLLECTION</font></a>[<font color="#008000">E</font>];
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">comment</font></strong> := <font color="#BC8F8F">"Common root for ARRAY[E] and FAST_ARRAY[E]."</font>;
  
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Inherit</font></strong>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">parent_arrayed</font></strong>:<a href="ARRAYED.html"><font color="#008000">ARRAYED</font></a> := 
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">parent_collection</font></strong>:<a href="COLLECTION.html"><font color="#008000">COLLECTION</font></a>[<font color="#008000">E</font>] := 
  
<br><br><strong><font color="#A020F0">Section</font></strong> <a href="ARRAYED_COLLECTION.html"><font color="#008000">ARRAYED_COLLECTION</font></a>, <a href="BMP_FILE.html"><font color="#008000">BMP_FILE</font></a>, <a href="TYPES.html"><font color="#008000">TYPES</font></a>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">storage</font></strong>:<a href="NATIVE_ARRAY.html"><font color="#008000">NATIVE_ARRAY</font></a>[<font color="#008000">E</font>];
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Internal access to storage location.</font></strong></em>
    
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Public</font></strong>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">element_sizeof</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <- 
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  The size in number of bytes for type `E'.</font></strong></em>
    
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">capacity</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Internal storage capacity in number of item.</font></strong></em>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">upper</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Upper index bound.</font></strong></em>
      
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">subarray</font></strong> min:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <strong><font color="#0000FF">to</font></strong> max:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> :<font color="#008000">SELF</font> <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  New collection consisting of items at indexes in [`min' .. `max'].</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Result has the same dynamic type as `Current'.</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  See also `slice'.</font></strong></em>
    
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  <br><font FACE="Sans-serif" color="#000000"><B> Implementation of deferred:</B></font>
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">first</font></strong>:<font color="#008000">E</font> <- 
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">second</font></strong>:<font color="#008000">E</font> <- 
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">last</font></strong> :<font color="#008000">E</font> <- 
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">add</font></strong> element:<font color="#008000">E</font> <strong><font color="#0000FF">to</font></strong> index:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
      
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">remove_last</font></strong> <-
    
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">remove_tail</font></strong> n:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
    
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">replace_all</font></strong> old_value:<font color="#008000">E</font> <strong><font color="#0000FF">with</font></strong> new_value:<font color="#008000">E</font> <-
      
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">fast_replace_all</font></strong> old_value:<font color="#008000">E</font> <strong><font color="#0000FF">with</font></strong> new_value:<font color="#008000">E</font> <-
    
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">reverse</font></strong> <-
    
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  <br><font FACE="Sans-serif" color="#000000"><B> Interfacing with C:</B></font>
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">to_external</font></strong>:<a href="POINTER.html"><font color="#008000">POINTER</font></a> <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Gives C access into the internal `storage' of the ARRAY.</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Result is pointing the element at index `lower'.</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp </font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  NOTE: do not free/realloc the Result. Resizing of the array</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp        can makes this pointer invalid.</font></strong></em>
    
<br><br><strong><font color="#A020F0">Section</font></strong> <a href="ARRAYED_COLLECTION.html"><font color="#008000">ARRAYED_COLLECTION</font></a>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">set_upper</font></strong> new_upper:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
    
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  <br><font FACE="Sans-serif" color="#000000"><B> invariant</B></font>
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  
<br><font FACE="Sans-serif" color="#000000"><B>  [</B></font>
<br><font FACE="Sans-serif" color="#000000"><B>    -? {capacity >= (upper - lower + 1)};</B></font>
<br><font FACE="Sans-serif" color="#000000"><B>    -? {(capacity > 0) ->> {storage.is_not_null}};</B></font>
<br><font FACE="Sans-serif" color="#000000"><B>  ];</B></font>

<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Public</font></strong>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">add_last_buffer</font></strong> buf:<a href="FAST_ARRAY.html"><font color="#008000">FAST_ARRAY</font></a>[<a href="UINTEGER_8.html"><font color="#008000">UINTEGER_8</font></a>] <strong><font color="#0000FF">from</font></strong> beg:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <strong><font color="#0000FF">to</font></strong> end:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
 
</body>
</html>