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) #

[View source]
def self.new(*data) #

[View source]

Class Method Detail

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

[View source]

Instance Method Detail

def +(item : Value) #

[View source]
def +(other : Crinja::Tuple) #

[View source]
def <=>(*args, **options) #

[View source]
def <=>(*args, **options, &) #

[View source]
def ==(other : Crinja::Tuple) #

[View source]
def ==(arg) #
Description copied from class Reference

Returns false (other can only be a Value here).


[View source]
def pretty_print(pp) : Nil #

[View source]
def size(*args, **options) #

[View source]
def size(*args, **options, &) #

[View source]
def to_s(io) #

[View source]
def to_s(*args, **options) #

[View source]
def to_s(*args, **options, &) #

[View source]
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.


[View source]