Instance methods
__make_type(name :
String, lexical_scope :
Scope |
Nil, parent_type = @base_type)
Create a new, fully initialized TType object. This takes care of setting
the lexical scope, inheriting from the base type and more.
Source__raise_not_found(name, value : MTValue | Nil)
Source__raise_runtime_error(message :
String)
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.
Source__raise_runtime_error(value : MTValue)
Source__raise_runtime_error(error : RuntimeError)
Source__scopeof(value : MTValue, prefer_instance_scope = false) : Scope
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.
Source__typeof(value : MTValue)
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.
Sourcebase_object
The true base type of every object in Myst.
Sourcebase_object=(base_object : TType)
The true base type of every object in Myst.
Sourcebase_type
The base Type for all type objects.
Sourcebase_type=(base_type : TType)
The base Type for all type objects.
Sourcebool_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcebool_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcebool_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcecallstack
Current stack of method calls/code blocks at any point in the interpreter.
Sourcecallstack=(callstack : Callstack)
Current stack of method calls/code blocks at any point in the interpreter.
Sourceenv_assign(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceenv_delete(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceenv_fetch(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceenv_get(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceenv_keys(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceenv_values(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefd_pool
The pool of open file descriptors used to avoid duplicating entries.
Sourcefile_close(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefile_init(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefile_size(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_add(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_divide(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_gt(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_gte(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_lt(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_lte(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_modulo(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_multiply(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_negate(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_round(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_subtract(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_to_i(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefloat_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcefunc_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceinit_file(fd_type : TType)
Sourceinit_file_descriptor(io_type : TType)
Sourceinit_tcp_socket(io_type)
Sourceint_add(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_divide(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_gt(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_gte(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_lt(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_lte(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_modulo(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_multiply(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_negate(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_subtract(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_to_f(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceint_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceio_fd_init(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceio_fd_read(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceio_fd_write(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceio_read(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceio_write(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcekernel
The Kernel module for this instance of the interpreter.
Sourcekernel=(kernel : TModule)
The Kernel module for this instance of the interpreter.
Sourcelist_access(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_access_assign(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_add(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_each(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_minus(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_pop(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_proper_subset(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_push(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_shift(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_size(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_splat(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_subset(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcelist_unshift(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceload_dirs
The set of directories that should be considered when performing lookups
with bare paths (not explicitly relative).
Sourceloaded_files
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.
SourceA 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.
Sourcelookup(node)
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.
Sourcemap_access(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcemap_access_assign(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcemap_add(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcemap_each(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcemap_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcemap_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcemap_proper_subset(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcemap_size(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcemap_subset(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcematch(pattern : Node, value : MTValue)
Sourcemt_doc(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcemt_exit(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcemt_sleep(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcenil_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcenil_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcenil_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceobj_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceobj_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourceobj_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcepassthrough_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
Sourcepassthrough_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
Sourcepassthrough_File_size(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcepassthrough_File_symlink(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcepassthrough_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
Sourcepop_callstack(to_size : Int)
Sourcepop_scope_override(to_size : Int)
Sourcepush_scope_override(scope : Scope = Scope.new)
Sourcepush_self(new_self : MTValue)
Sourceput_error(error : RuntimeError)
Sourcerandom_rand(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcerecursive_lookup(receiver, name, check_current = true)
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.
Sourcerun(program, capture_errors = true)
Sourcescope_stack
Stack of scopes representing the current lexical scope.
Sourcescope_stack=(scope_stack : Array(Scope))
Stack of scopes representing the current lexical scope.
Sourceself_stack
Value stack representing the current receiver value for operations.
Sourceself_stack=(self_stack : Array(MTValue))
Value stack representing the current receiver value for operations.
Sourcestack
Value stack the the interpreter uses to pass around arguments and values.
Sourcestack=(stack : Array(MTValue))
Value stack the the interpreter uses to pass around arguments and values.
Sourcestatic_File_each_line(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestatic_File_join(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestatic_File_lines(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestatic_time_now(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestatic_type_ancestors(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestatic_type_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestatic_type_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestatic_type_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_add(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_at(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_chars(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_chomp(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_downcase(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_includes?(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_lstrip(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_multiply(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_reverse(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_rstrip(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_size(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_split(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_strip(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_to_f(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_to_i(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcestring_upcase(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcesymbol_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcesymbol_not_eq(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcesymbol_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcetcp_socket_init(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcetcp_socket_read(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcetcp_socket_write(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcetime_to_s(this : MTValue, __args : Array(MTValue), block : TFunctor | Nil) : MTValue
Sourcevisit(node : AnonymousFunction)
Sourcevisit(node : And)
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.
Sourcevisit(node : ExceptionHandler)
Sourcevisit(node : Expressions)
Sourcevisit(node : FunctionCapture)
Sourcevisit(node : Instantiation)
Sourcevisit(node : ValueInterpolation)
Sourcevisit(node : ListLiteral)
Sourcevisit(node : MapLiteral)
Sourcevisit(node : InterpolatedStringLiteral)
Sourcevisit(node : MagicConst)
Sourcevisit(node : Match)
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.
Sourcevisit(node : MatchAssign)
Sourcevisit(node : Underscore)
Sourcevisit(node : SimpleAssign)
Sourcevisit_and_assign(node : OpAssign)
Sourcevisit_or_assign(node : OpAssign)
Sourcewarnings
The number of warnings generated by execution of programs.
Sourcewarnings=(warnings : Int32)
The number of warnings generated by execution of programs.
Source