class Myst::Interpreter
- Myst::Interpreter
- Reference
- Object
Defined in:
myst/interpreter.crmyst/interpreter/kernel.cr
myst/interpreter/matcher.cr
myst/interpreter/native_lib/boolean.cr
myst/interpreter/native_lib/env.cr
myst/interpreter/native_lib/file.cr
myst/interpreter/native_lib/float.cr
myst/interpreter/native_lib/functor.cr
myst/interpreter/native_lib/integer.cr
myst/interpreter/native_lib/io.cr
myst/interpreter/native_lib/io/file_descriptor.cr
myst/interpreter/native_lib/list.cr
myst/interpreter/native_lib/map.cr
myst/interpreter/native_lib/nil.cr
myst/interpreter/native_lib/object.cr
myst/interpreter/native_lib/random.cr
myst/interpreter/native_lib/string.cr
myst/interpreter/native_lib/symbol.cr
myst/interpreter/native_lib/tcp_socket.cr
myst/interpreter/native_lib/time.cr
myst/interpreter/native_lib/top_level.cr
myst/interpreter/native_lib/type.cr
myst/interpreter/nodes/anonymous_function.cr
myst/interpreter/nodes/binary_ops.cr
myst/interpreter/nodes/call.cr
myst/interpreter/nodes/conditionals.cr
myst/interpreter/nodes/control_exprs.cr
myst/interpreter/nodes/def.cr
myst/interpreter/nodes/doc.cr
myst/interpreter/nodes/exception_handler.cr
myst/interpreter/nodes/expressions.cr
myst/interpreter/nodes/extend.cr
myst/interpreter/nodes/function_capture.cr
myst/interpreter/nodes/include.cr
myst/interpreter/nodes/instantiation.cr
myst/interpreter/nodes/interpolation.cr
myst/interpreter/nodes/literals.cr
myst/interpreter/nodes/loops.cr
myst/interpreter/nodes/magic_const.cr
myst/interpreter/nodes/match.cr
myst/interpreter/nodes/match_assign.cr
myst/interpreter/nodes/module_def.cr
myst/interpreter/nodes/nop.cr
myst/interpreter/nodes/op_assign.cr
myst/interpreter/nodes/raise.cr
myst/interpreter/nodes/references.cr
myst/interpreter/nodes/require.cr
myst/interpreter/nodes/self.cr
myst/interpreter/nodes/simple_assign.cr
myst/interpreter/nodes/type_def.cr
myst/interpreter/nodes/unary_ops.cr
myst/interpreter/util.cr
Constructors
Class Method Summary
Instance Method Summary
-
#__make_type(name : String, lexical_scope : Scope | Nil, parent_type = @base_type)
Create a new, fully initialized TType object.
- #__raise_not_found(name, value : MTValue | Nil)
-
#__raise_runtime_error(message : String)
Raise a RuntimeError from the current location.
- #__raise_runtime_error(value : MTValue)
- #__raise_runtime_error(error : RuntimeError)
-
#__scopeof(value : MTValue, prefer_instance_scope = false) : Scope
Resolve the Scope for
value
. -
#__typeof(value : MTValue)
Resolve the TType object representing the type of
value
. -
#base_object : TType
The true base type of every object in Myst.
-
#base_object=(base_object : TType)
The true base type of every object in Myst.
-
#base_type : TType
The base Type for all type objects.
-
#base_type=(base_type : TType)
The base Type for all type objects.
- #bool_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #bool_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #bool_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
-
#callstack : Callstack
Current stack of method calls/code blocks at any point in the interpreter.
-
#callstack=(callstack : Callstack)
Current stack of method calls/code blocks at any point in the interpreter.
- #create_kernel : TModule
- #current_scope
- #current_self
-
#doc_table : Hash(MTValue, DocComment)
A mapping of values to documentation about that value.
-
#doc_table=(doc_table : Hash(MTValue, DocComment))
A mapping of values to documentation about that value.
- #env_assign(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #env_delete(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #env_fetch(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #env_get(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #env_keys(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #env_values(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #errput
- #errput=(other)
-
#fd_pool : Hash(Int32, IO)
The pool of open file descriptors used to avoid duplicating entries.
- #file_close(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #file_init(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #file_size(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_add(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_divide(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_gt(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_gte(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_lt(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_lte(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_modulo(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_multiply(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_negate(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_round(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_subtract(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_to_i(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #float_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #func_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #init_base_object
- #init_base_type
- #init_boolean
- #init_env
- #init_file(fd_type : TType)
- #init_file_descriptor(io_type : TType)
- #init_float
- #init_functor
- #init_integer
- #init_io
- #init_list
- #init_map
- #init_nil
- #init_random
- #init_string
- #init_symbol
- #init_tcp_socket(io_type)
- #init_time
- #init_top_level
- #input
- #input=(other)
- #int_add(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_divide(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_gt(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_gte(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_lt(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_lte(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_modulo(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_multiply(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_negate(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_subtract(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_to_f(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #int_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #io_fd_init(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #io_fd_read(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #io_fd_write(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #io_read(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #io_write(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
-
#kernel : TModule
The Kernel module for this instance of the interpreter.
-
#kernel=(kernel : TModule)
The Kernel module for this instance of the interpreter.
- #list_access(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_access_assign(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_add(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_each(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_minus(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_pop(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_proper_subset(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_push(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_shift(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_size(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_splat(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_subset(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #list_unshift(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
-
#load_dirs
The set of directories that should be considered when performing lookups with bare paths (not explicitly relative).
-
#loaded_files : Hash(String, Bool)
A Hash of entries indicating files that have already been loaded.
-
#loaded_files=(loaded_files : Hash(String, Bool))
A Hash of entries indicating files that have already been loaded.
-
#lookup(node)
Lookup a value under the given name in the current scope or one of its ancestors.
- #map_access(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #map_access_assign(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #map_add(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #map_each(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #map_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #map_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #map_proper_subset(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #map_size(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #map_subset(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #match(pattern : Node, value : MTValue)
- #mt_doc(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #mt_exit(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #mt_sleep(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #nil_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #nil_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #nil_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #obj_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #obj_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #obj_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #output
- #output=(other)
- #passthrough_ENV_clear(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_ENV_has_key?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_basename(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_chmod(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_delete(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_directory?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_dirname(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_empty?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_executable?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_exists?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_expand_path(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_extname(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_file?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_link(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_read(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_readable?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_real_path(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_rename(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_size(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_symlink(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_symlink?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_touch(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_writable?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #passthrough_File_write(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #pop_callstack(to_size : Int)
- #pop_scope_override(to_size : Int)
- #pop_scope_override
- #pop_self(to_size : Int)
- #pop_self
- #push_scope_override(scope : Scope = Scope.new)
- #push_self(new_self : MTValue)
- #put_error(error : RuntimeError)
- #random_rand(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
-
#recursive_lookup(receiver, name, check_current = true)
Attempt to lookup the given name recursively through the ancestry of the given receiver.
- #run(program, capture_errors = true)
- #scope_override
-
#scope_stack : Array(Scope)
Stack of scopes representing the current lexical scope.
-
#scope_stack=(scope_stack : Array(Scope))
Stack of scopes representing the current lexical scope.
-
#self_stack : Array(MTValue)
Value stack representing the current receiver value for operations.
-
#self_stack=(self_stack : Array(MTValue))
Value stack representing the current receiver value for operations.
-
#stack : Array(MTValue)
Value stack the the interpreter uses to pass around arguments and values.
-
#stack=(stack : Array(MTValue))
Value stack the the interpreter uses to pass around arguments and values.
- #static_File_each_line(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #static_File_join(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #static_File_lines(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #static_time_now(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #static_type_ancestors(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #static_type_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #static_type_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #static_type_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_add(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_at(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_chars(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_chomp(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_downcase(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_includes?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_lstrip(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_multiply(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_reverse(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_rstrip(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_size(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_split(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_strip(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_to_f(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_to_i(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #string_upcase(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #symbol_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #symbol_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #symbol_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #tcp_socket_init(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #tcp_socket_read(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #tcp_socket_write(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #time_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
- #visit(node : AnonymousFunction)
-
#visit(node : And)
The result of either expression, in any case, will be the value that determined the result.
- #visit(node : Or)
- #visit(node : Call)
- #visit(node : When)
- #visit(node : Unless)
- #visit(node : Return)
- #visit(node : Break)
- #visit(node : Next)
- #visit(node : Def)
- #visit(node : DocComment)
- #visit(node : ExceptionHandler)
- #visit(node : Expressions)
- #visit(node : Extend)
- #visit(node : FunctionCapture)
- #visit(node : Include)
- #visit(node : Instantiation)
- #visit(node : ValueInterpolation)
- #visit(node : ListLiteral)
- #visit(node : MapLiteral)
- #visit(node : InterpolatedStringLiteral)
- #visit(node : Literal)
- #visit(node : While)
- #visit(node : Until)
- #visit(node : MagicConst)
-
#visit(node : Match)
Matches are syntax sugar for the creation and immediate invocation of an anonymous function.
- #visit(node : MatchAssign)
- #visit(node : ModuleDef)
- #visit(node : Nop)
- #visit(node : OpAssign)
- #visit(node : Raise)
- #visit(node : Var)
- #visit(node : IVar)
- #visit(node : Const)
- #visit(node : Underscore)
- #visit(node : Require)
- #visit(node : Self)
- #visit(node : SimpleAssign)
- #visit(node : TypeDef)
- #visit(node : Negation)
- #visit(node : Not)
- #visit(node : Splat)
- #visit(node : Node)
- #visit_and_assign(node : OpAssign)
- #visit_or_assign(node : OpAssign)
- #warn(message : String, node : Node)
-
#warnings : Int32
The number of warnings generated by execution of programs.
-
#warnings=(warnings : Int32)
The number of warnings generated by execution of programs.
Macro Summary
-
__disallow_primitives(value, operation = nil)
Primitive types have some restrictions on functionality.
Constructor Detail
Class Method Detail
Instance Method Detail
Create a new, fully initialized TType object. This takes care of setting the lexical scope, inheriting from the base type and more.
Raise a RuntimeError from the current location. Execution is immediataly halted and the interpreter will panic up until a rescuer is found.
Multiple overloads of this function are provided for simplicity at the call site.
Resolve the Scope for value
. For primitives, this returns the instance
scope of the Type for that value. For Instances, Types, and Modules, this
just returns .scope
for that value.
Resolve the TType object representing the type of value
. For primitive
types, these are always looked up in the Kernel. For Instances, the
type is looked up from the type reference on the instance itself. For
Types and Modules, the value itself is returned.
Current stack of method calls/code blocks at any point in the interpreter.
Current stack of method calls/code blocks at any point in the interpreter.
A mapping of values to documentation about that value. Mostly applied to modules, types, and methods.
A mapping of values to documentation about that value. Mostly applied to modules, types, and methods.
The pool of open file descriptors used to avoid duplicating entries.
The Kernel module for this instance of the interpreter.
The set of directories that should be considered when performing lookups with bare paths (not explicitly relative).
A Hash of entries indicating files that have already been loaded. Entries in this Hash should always be absolute paths to avoid ambiguity between relative paths that resolve to the same file.
A Hash of entries indicating files that have already been loaded. Entries in this Hash should always be absolute paths to avoid ambiguity between relative paths that resolve to the same file.
Lookup a value under the given name in the current scope or one of its
ancestors. If the value is not found, a No variable or method
RuntimeError will be raised.
Attempt to lookup the given name recursively through the ancestry of the
given receiver. This is mainly used for method lookup, where the simple
#lookup
method does not search deep enough for a value.
The method will return nil
if no matching entry is found.
Stack of scopes representing the current lexical scope.
Stack of scopes representing the current lexical scope.
Value stack representing the current receiver value for operations.
Value stack representing the current receiver value for operations.
Value stack the the interpreter uses to pass around arguments and values.
Value stack the the interpreter uses to pass around arguments and values.
The result of either expression, in any case, will be the value that
determined the result. i.e., in the expression true && false
, the
result will be false
, while nil && false
will result in nil
.
Matches are syntax sugar for the creation and immediate invocation of an anonymous function. As such, they can be re-written into a Call of an AnonymousFunction node. For example: match x, y ->(true) { } ->(false) { } ->(_) { } end would be expanded to (fn ->(true) { } ->(false) { } ->(_) { } end)(x, y) which is semantically equivalent.
Macro Detail
Primitive types have some restrictions on functionality. This method will
raise an appropriate error if the given value is a primitive.
If operation
is given, it will be used as the error message.