From 0e699be281c8dea53e589e08a5831837e0eae7ea Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 7 Oct 2021 20:17:50 -0400 Subject: Updates for Chickadee 0.8.0 and Guile-SDL2 0.7.0. --- manuals/chickadee/Array-Lists.html | 179 +++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 manuals/chickadee/Array-Lists.html (limited to 'manuals/chickadee/Array-Lists.html') diff --git a/manuals/chickadee/Array-Lists.html b/manuals/chickadee/Array-Lists.html new file mode 100644 index 0000000..28e1835 --- /dev/null +++ b/manuals/chickadee/Array-Lists.html @@ -0,0 +1,179 @@ + + + + + + +Array Lists (The Chickadee Game Toolkit) + + + + + + + + + + + + + + + + + + + +
+

+Next: , Up: Data Structures   [Contents][Index]

+
+
+

5.6.1 Array Lists

+ +

The (chickadee data array-list) module provides an array/vector +that dynamically expands to hold all of the data that is added to it. +It is named after the ArrayList class in Java. +

+

In addition to being used as a dynamic vector, it can also be used as +a stack via the array-list-push! and array-list-pop! +procedures. +

+
+
Procedure: make-array-list [initial-capacity]
+

Return a new empty array list with an initial capacity of +initial-capacity, or 32 by default. +

+ +
+
Procedure: array-list items ...
+

Return a new array list with items in it. +

+ +
+
Procedure: array-list? obj
+

Return #t if obj is an array list. +

+ +
+
Procedure: array-list-empty? array-list
+

Return #t if array-list is empty. +

+ +
+
Procedure: array-list-size array-list
+

Return the current size of array-list. +

+ +
+
Procedure: array-list-ref array-list i
+

Return the item in array-list at index i. +

+ +
+
Procedure: array-list-set! array-list i value
+

Set the value in array-list at index i to value. +

+ +
+
Procedure: array-list-push! array-list item
+

Append item to array-list. +

+ +
+
Procedure: array-list-pop! array-list
+

Remove and return the last object in array-list. +

+ +
+
Procedure: array-list-delete! array-list item [#:equal? equal?] [#:fast? #f]
+

Delete item from array-list. Use equal? as the +equivalence predicate, which defaults to Guile’s equal? +procedure. By default, deletion preserves the order of the array, but +takes linear time in the worst case. If fast? is #t then +item will deleted in constant time, but order is not preserved. +

+ +
+
Procedure: array-list-clear! array-list
+

Remove all items from array-list. +

+ +
+
Procedure: array-list-for-each proc array-list
+

Apply PROC with each item in array-list. +

+ +
+
Procedure: array-list-fold proc init array-list
+

Apply proc to all items in array-list to build a result and +return that result. init is the initial result. If there are +no objects in the vicinity of rect, just init is returned. +

+ +
+
+

+Next: , Up: Data Structures   [Contents][Index]

+
+ + + + + -- cgit v1.2.3