struct

X::Value::Context

Inherits Struct / Value / Object

Constructors

new(object : Nil)
Source
new(object : Int64)

Integer — store raw bits; reinterpret on read

Source
new(object : UInt64)

Unsigned Integer — stored directly

Source
new(object : Float64)

Float — store raw IEEE 754 bits

Source
new(object : Bool)

Boolean — 0 or 1

Source
new(object : Symbol)

Symbol — boxed (Crystal symbols cannot be reconstructed from ordinals)

Source
new(object : String)
Source
new(object : Hash(String, Context))
Source
new(object : Array(Context))
Source
new(slice : Slice(UInt8))

Binary — copies the slice to ensure ownership

Source
new(object : Lambda::Context)
Source
new(object : Array(Instruction::Operation))
Source
new(object : Tuple(Array(Instruction::Operation), Array(String)))
Source
new(object : Process::MonitorReference)
Source
new(object : Object)

Generic fallback for unknown custom types

Source
new

Null

Source
null

Class-level null singleton

Source

Instance methods

<(other : Context) : Bool
Source
<=(other : Context) : Bool
Source
<=>(other : Context) : Int32
Source
==(other : Context) : Bool
Source
>(other : Context) : Bool
Source
>=(other : Context) : Bool
Source
array?
Source
binary?
Source
boolean?
Source
clone
Source
custom?
Source
custom_type

Getters for compatibility

Source
float?
Source
hash(hasher)

See Object#hash(hasher)

Source
heap_term?

Erlang-style: is this a heap-allocated term?

Source
immediate?

Erlang-style: is this an immediate (no heap pointer)?

Source
inspect

Returns an unambiguous and information-rich string representation of this object, typically intended for developers.

This method should usually not be overridden. It delegates to #inspect(IO) which can be overridden for custom implementations.

Also see #to_s.

Source
instructions?
Source
integer?
Source
is_binary?

Erlang-style is_binary guard

Source
is_function?

Erlang-style is_function guard

Source
is_list?

Erlang-style is_list guard

Source
is_map?

Erlang-style is_map guard

Source
is_number?

Erlang-style is_number guard

Source
is_symbol?

Erlang-style is_symbol guard (symbols are our symbols)

Source
lambda?
Source
lambda_definition?
Source
map?
Source
match_array_size?(expected : Int32) : Array(Context) | Nil

Match an array by size and return it if it matches

Source
match_map_key?(key : String) : Context | Nil

Match a map value and extract a key in one step (avoids double lookup)

Source
matches_type?(expected_tag : UInt8) : Bool

Match against a type tag — used in guard clauses

Source
monitor_reference?
Source
null?
Source
numeric?

Numeric covers integer, unsigned integer, and float — contiguous tags

Source
pointer

Returns the raw pointer for heap terms

Source
primitive_type
Source
string?
Source
symbol?
Source
to_a
Source
to_binary
Source
to_bool
Source
to_f64
Source
to_h
Source
to_i64
Source
to_instructions
Source
to_lambda
Source
to_lambda_definition
Source
to_monitor_reference
Source
to_s(io : IO) : Nil

IO overload — required for string interpolation to use our to_s

Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source
to_symbol
Source
to_u64
Source
tuple?
Source
type
Source
unsigned_integer?
Source