struct Pf::UPath32

Overview

An immutable vector of UInt32s with tree path-specific optimizations.

Included Modules

Defined in:

permafrost/upath32.cr

Constructors

Instance Method Summary

Instance methods inherited from module Enumerable(UInt32)

to_pf_bidi to_pf_bidi, to_pf_map(& : T -> Tuple(K, V)) : Pf::Map(K, V) forall K, V
to_pf_map
to_pf_map
, to_pf_set : Pf::Set(T) to_pf_set, to_pf_uset32 : Pf::USet32 to_pf_uset32

Constructor Detail

def self.[] : UPath32 #

Constructs an empty path.


[View source]
def self.[](*ns : UInt32) : UPath32 #

[View source]

Instance Method Detail

def [](object) #

Calls one of the #[]? overloads. Raises IndexError instead of returning nil.


[View source]
def []?(index : Int) : UInt32 | Nil #

Returns index-th n of this path.


[View source]
def []?(range : Range) : UPath32 | Nil #

Returns a subview of this path.


[View source]
def append(n : UInt32) : UPath32 #

Inserts n at the back of this path. Returns a modified copy.


[View source]
def each(& : UInt32 -> ) #

Yields each n in this path, left to right.


[View source]
def goto(n : UInt32) : UPath32 #

Makes n the tip of this path. Returns a modified copy. If this path is empty, does nothing.


[View source]
def inspect(io) #

[View source]
def prepend(n : UInt32) : UPath32 #

Inserts n at the front of this path. Returns a modified copy.


[View source]
def prior : UPath32 #

Removes the last n of this path. Returns a modified copy. If this path is empty, does nothing.


[View source]
def rest : UPath32 #

Removes the first n of this path. Returns a modified copy. If this path is empty, does nothing.


[View source]
def size : UInt32 #

Returns the number of ns in this path.


[View source]
def tip : UInt32 #

Returns the last n of this path (its tip), or raises IndexError if this path is empty.


[View source]
def tip? : UInt32 | Nil #

Returns the last n of this path (its tip), or nil if this path is empty.


[View source]