class Ven::Suite::MVector

Overview

Ven's vector data type.

Defined in:

ven/suite/model.cr

Constructors

Instance Method Summary

Instance methods inherited from class Ven::Suite::MClass

[]=(referent : Model, value : Model) : Model | Nil []=, []?(index : Int)
[]?(index : Range)
[]?
, callable? : Bool callable?, eqv?(other : Model) : Bool eqv?, false? : Bool false?, field(name : String) : Model | Nil field, indexable? indexable?, length : Int32 length, match(other : Model) match, nth(index : Num)
nth(range : MRange)
nth(other)
nth
, of?(other : MType) : Bool
of?(other : MAny)
of?(other)
of?
, set_referent(referent : Model, value : Model) : Model set_referent, to_bool(inverse = false) : MBool to_bool, to_num : Num to_num, to_str : Str to_str, to_vec : Vec to_vec, true? : Bool true?, weight : MWeight weight

Constructor Detail

def self.new(value : Array(MClass) | Array(MStruct)) #

[View source]
def self.new(value : Array(Ven::Suite::MClass | Ven::Suite::MStruct) = Models.new) #

[View source]

Instance Method Detail

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

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

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

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

[View source]
def []=(index : Num, value : Model) #

[View source]
def []?(index : Int) #
Description copied from class Ven::Suite::MClass

Returns index-th item of this model.

Subclasses should rather override this method instead of nth.


[View source]
def []?(range : Range) #
Description copied from class Ven::Suite::MClass

Returns a subset of items in this model.

Subclasses should rather override this method instead of nth.


[View source]
def callable? #
Description copied from class Ven::Suite::MClass

Returns whether this model is callable.


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

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

[View source]
def eqv?(other : Vec) #

[View source]
def indexable? #
Description copied from class Ven::Suite::MClass

Returns whether this model is indexable (i.e., properly implements nth).


[View source]
def length #
Description copied from class Ven::Suite::MClass

Returns the length (#) of this model.


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

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

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

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

[View source]
def to_num #

Returns the length of this vector.


[View source]
def to_s(io) #

[View source]
def to_vec #
Description copied from class Ven::Suite::MClass

Converts (casts) this model into a Vec.


[View source]
def true? #
Description copied from class Ven::Suite::MClass

Returns whether this model is semantically true.


[View source]

[View source]