Skip to content

Latest commit

 

History

History
executable file
·
40 lines (27 loc) · 774 Bytes

gen_idx.md

File metadata and controls

executable file
·
40 lines (27 loc) · 774 Bytes

Summary

gen_idx

Generational Index module

GenIdx

local GenIdx = @record{
  index: usize,      -- 0-based, since this is an index for arrays
  generation: uint16, -- 1-based: 1 is the "first" valid generation, 0 is invalid
}

Generational Indexes, it identifies an index with a generation, making each index unique between re-uses.

GenIdx.__eq

function GenIdx.__eq(l: GenIdx, r: GenIdx): boolean

Equality test for generational indexes.

It compares if the index and the generation of both operands are equal.

GenIdx.is_valid

function GenIdx.is_valid(self: GenIdx): boolean

Returns if a certain generational index is valid