Vector Struct:   Performant Fake Structs
1 API
vecstruct
8.0

Vector Struct: Performant Fake Structs

 (require typed/vector-struct) package: vector-struct

This module is a typed variant of the vector-struct module. See its documentation for examples and additional information.

1 API

syntax

(vecstruct id ([field-id : field-type] ...) struct-option ...)

 
struct-option = #:mutable
Creates utility functions for creating and manipulating vectors to emulate structs. Defines id as a constructor taking the number of parameters as there are field-id elements. Each element is typed with the corresponding field-type. Also defines id? as a predicate to identify if a given object fits the proper underlying struct format.

Subsequently generates a series of id-field-id accessors. If #:mutable is specified, also generates set-id-field-id! mutators.

If #:mutable is specified, then the underlying datatype will be a mutable vector, otherwise it will be an immutable vector.