class Crinja::Tuple

Overview

Implementation of a Python Tuple

Included Modules

Defined in:

runtime/tuple.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(data : Array(Value) = Array(Value).new) #

def self.new(*data) #

Class Method Detail

def self.from(data : Iterable, *add) #

Instance Method Detail

def +(item : Value) #

def +(other : Crinja::Tuple) #

def <=>(*args, **options) #

def <=>(*args, **options, &) #

def ==(other : Crinja::Tuple) #

def ==(*args, **options) #

def ==(*args, **options, &) #

def pretty_print(pp) : Nil #

def size(*args, **options) #

def size(*args, **options, &) #

def to_s(io) #

def to_s(*args, **options) #

def to_s(*args, **options, &) #

def unsafe_fetch(index : Int) : Value #
Description copied from module Indexable(Crinja::Value)

Returns the element at the given index, without doing any bounds check.

Indexable makes sure to invoke this method with index in 0...size, so converting negative indices to positive ones is not needed here.

Clients never invoke this method directly. Instead, they access elements with #[](index) and #[]?(index).

This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.