abstract class Ven::Suite::MFunction
- Ven::Suite::MFunction
- Ven::Suite::MClass
- Reference
- Object
Overview
An abstract umbrella for various kinds of functions.
Direct Known Subclasses
- Ven::Suite::MBox
- Ven::Suite::MBuiltinFunction
- Ven::Suite::MConcreteFunction
- Ven::Suite::MGenericFunction
- Ven::Suite::MPartial
Defined in:
ven/suite/model.crInstance Method Summary
-
#callable?
Returns whether this model is callable.
-
#leading?(type : Model)
Returns whether this function may take type as its leading (first-expected) parameter.
-
#pg(params : Array(String), given : Models)
Pretty-prints params alongside given.
-
#specificity : Int32
Returns the specificity of this function, which is 0 by default.
-
#variant?(args : Models)
Performs the checks that ensure this function can receive args.
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
Instance Method Detail
def callable?
#
Description copied from class Ven::Suite::MClass
Returns whether this model is callable.
Returns whether this function may take type as its leading (first-expected) parameter.
def variant?(args : Models)
#
Performs the checks that ensure this function can receive args. Returns nil if it cannot.