Skip to content

STL Buffer

TheRealMichaelWang edited this page Jun 30, 2021 · 1 revision

STL buffer.min

The code in this file implements utility procedures for collections/arrays. Many of these procedure's identifiers are quite akin to their C counterparts in both naming and functionality.

Usage

Type include "buffer.min" to include this library. If that isn't working, please make sure that:

  • The unzipped contents of stl.zip are placed in the working directory of minima.exe.
  • Your version of minima is up to date.

An Example

include "buffer.min"

set array to alloc[100]  rem allocates a new array with a capacity of 100

rem the code block bellow sets array to {99, 98, 97..., 0}
set i to extern len(100)
while dec i {
  set array[i] to i
}

set array to goproc realloc(array, 200)  rem expands the capacity of array to 200.

goproc memset(array, 0)  rem sets all the elements in array to 0

Clone this wiki locally