module Lua::StackMixin::Type
Direct including types
Defined in:
lua/stack/type.crInstance Method Summary
- #crystal_base_type_at(pos : Int)
- #crystal_type_at(pos : Int)
- #crystal_type_info_at(pos : Int)
-
#type_at(pos : Int)
Returns type at
pos
in the stack. -
#typename(pos : Int)
Returns name of the type at
pos
in the stack. -
#typename(type : TYPE)
Returns name of the
type
.
Instance Method Detail
def type_at(pos : Int)
#
Returns type at pos
in the stack.
stack = Lua::Stack.new
stack << "hello"
stack.type_at(1) # => TSTRING
def typename(pos : Int)
#
Returns name of the type at pos
in the stack.
stack = Lua::Stack.new
stack << "my_super_string"
stack << 42
stack.typename(1) # => "string"
stack.typename(2) # => "number"
stack.typename(3) # => "no value"
Returns name of the type
.
stack = Lub::Stack.new
stack.typename(TYPE::TBOOLEAN) # => "boolean"