KrkTuple Struct Reference

Immutable sequence of arbitrary values. More...

#include <object.h>

Inheritance diagram for KrkTuple:

Public Member Functions

KrkTuplekrk_newTuple (size_t length)
 Create a new tuple. More...
 
KrkValue krk_tuple_of (int argc, const KrkValue argv[], int hasKw)
 Create a tuple object.
 

Data Fields

KrkValueArray values
 Stores the length, capacity, and actual values of the tuple.
 
- Data Fields inherited from KrkObj
uint16_t type
 Tag indicating core type.
 
uint16_t flags
 General object flags, mostly related to garbage collection.
 
uint32_t hash
 Cached hash value for table keys.
 
struct KrkObjnext
 Invasive linked list of all objects in the VM.
 

Protected Attributes

KrkObj obj
 Base.
 

Detailed Description

Immutable sequence of arbitrary values.

Tuples are fixed-length non-mutable collections of values intended for use in situations where the flexibility of a list is not needed.

Definition at line 323 of file object.h.

Member Function Documentation

◆ krk_newTuple()

KrkTuple * krk_newTuple ( size_t  length)

Create a new tuple.

Creates a tuple object with the request space preallocated. The actual length of the tuple must be updated after places values within it by setting value.count.

Definition at line 357 of file object.c.


The documentation for this struct was generated from the following files: