class Ven::Suite::MVector
- Ven::Suite::MVector
- Ven::Suite::MClass
- Reference
- Object
Overview
Ven's vector data type.
Defined in:
ven/suite/model.crConstructors
- .new(value : Array(MClass) | Array(MStruct))
- .new(value : Array(Ven::Suite::MClass | Ven::Suite::MStruct) = Models.new)
Instance Method Summary
- #<<(*args, **options)
- #<<(*args, **options, &)
- #[](*args, **options)
- #[](*args, **options, &)
- #[]=(index : Num, value : Model)
-
#[]?(index : Int)
Returns index-th item of this model.
-
#[]?(range : Range)
Returns a subset of items in this model.
-
#callable?
Returns whether this model is callable.
- #each(*args, **options)
- #each(*args, **options, &)
- #eqv?(other : Vec)
-
#indexable?
Returns whether this model is indexable (i.e., properly implements
nth). -
#length
Returns the length (#) of this model.
- #map(*args, **options)
- #map(*args, **options, &)
- #size(*args, **options)
- #size(*args, **options, &)
-
#to_num
Returns the length of this vector.
- #to_s(io)
-
#to_vec
Converts (casts) this model into a
Vec. -
#true?
Returns whether this model is semantically true.
- #value : Array(Ven::Suite::MClass | Ven::Suite::MStruct)
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
Instance Method Detail
Returns index-th item of this model.
Subclasses should rather override this method instead
of nth.
Returns a subset of items in this model.
Subclasses should rather override this method instead
of nth.
Returns whether this model is callable.
Returns whether this model is indexable (i.e., properly
implements nth).
Converts (casts) this model into a Vec.
Returns whether this model is semantically true.