W Wrapl, The Programming Language

Libraries Wrapl.Loader

Types

ScopeT

ExternErrorMessageT

Inherits from:

ScopeErrorMessageT

Inherits from:

SemanticErrorMessageT

Inherits from:

TypeErrorMessageT

Inherits from:

InitErrorMessageT

Inherits from:

SourceErrorMessageT

Inherits from:

VariadicT

Used to collect extra arguments to a variadic function.

WraplPreT

Inherits from:

WraplT

Inherits from:

ExecT

Marks a state in the execution of a Wrapl function that can be restarted.

Calling an instance of ExecT will restart execution at the state stored in it.

IncorrectTypeMessageT

IncorrectAssignMessageT

CodeT

Inherits from:

ErrorMessageT

The type of error messages sent by the compiler.

SessionT

An incremental Wrapl compiler/interpreter

Constants

Message : Sys.Module.T

Possible error messages sent by the compiler.

Functions

ExecJump(exec @ ExecT, arg @ ANY = NIL)

Restarts current execution from the state in exec.

ExecMark(exec @ ExecT)

Stores the current execution state into exec.

Fails when called initially, succeeds if restarted by ExecJump.

ExecNew() : ExecT

Returns a new empty ExecT.

LoadExpr(filename @ Std.String.T) : ANY

Evaluates the expression contained in the file filename and returns the result.

LoadModule(filename @ Std.String.T) : Sys.Module.T

Loads and compiles the module contained in the file filename and returns the module handle.

ReadExpr(source @ IO.Stream.T) : ANY

Evaluates the expression read from source and returns the result.

ScopeNew()

SessionDef(session @ SessionT, name @ Std.String.T, value @ ANY)

Defines the constant name with value value in the global scope of session.

SessionEval(session @ SessionT) : ANY

Parses and evaluates the next value from session.

SessionLine(session @ SessionT) : Std.String.T

Returns the rest of the current line stored by the scanner in session.

SessionNew(src @ IO.Stream.ReaderT) : SessionT

Returns a new SessionT which reads source from src.

SessionVar(session @ SessionT, name @ Std.String.T, variable @ ANY)

Defines variable as a variable called name in the global scope of session.

VariadicNew()

Methods

:"@"(_ @ ErrorMessageT, _ = Std.String.T)

:"@"(_ @ IncorrectAssignMessageT, _ = Std.String.T)

:"@"(_ @ IncorrectTypeMessageT, _ = Std.String.T)

:add(session @ SessionT, scope @ ScopeT)

Adds an existing scope to the global scopes of session.

This code needs to be fixed, since scopes are stored in a linked list, and adding more than one scope to multiple sessions will not work correctly.

:append(args @ VariadicT, more...)

Creates a copy of args with the extra arguments more... at the end

:apply(args @ Std.Function.T, more... @ VariadicT, _)

:apply(args @ VariadicT, more... @ Std.Function.T, _)

:apply(func @ Std.Function.T, args @ VariadicT)

Calls func with args.

:apply(args @ VariadicT, func @ Std.Function.T)

Calls func with args.

:def(session @ SessionT, name @ Std.String.T, value)

The same as SessionDef(session, name, value).

:def(_ @ ScopeT, _ @ Std.String.T, _)

:eval(session @ SessionT) : ANY

The same as SessionEval(session).

:eval_line(session @ SessionT, _) : ANY

The same as SessionEval(session).

:expr(session @ SessionT) : ANY

The same as SessionExpr(session).

:get(session @ SessionT, name @ Std.String.T) : ANY

:length(args @ VariadicT) : Std.Integer.SmallT

Returns the number of arguments in args.

:line(session @ SessionT) : Std.String.T

The same as SessionLine(session).

:mark(exec @ ExecT)

Stores the current execution state into exec.

:prepend(args @ VariadicT, more...)

Creates a copy of args with the extra arguments more... at the beginning

:values(_ @ VariadicT, _ = Std.Object.Nil, _)

:values(values @ VariadicT, keys @ Std.Symbol.ArrayT, key+) : ANY

Generates the arguments in args, while filling key from keys in parallel.

:values(args @ VariadicT) : ANY

Generates the arguments in args.

:var(session @ SessionT, name @ Std.String.T, variable)

The same as SessionVar(session, name, variable).

:var(_ @ ScopeT, _ @ Std.String.T, _)