Table of Contents

Class EzrBuiltinFunctions

Namespace
EzrSquared.Runtime.Types.Builtins
Assembly
ezrSquared-lib.dll

All built-in functions in ezr².

public static class EzrBuiltinFunctions
Inheritance
object
EzrBuiltinFunctions

Methods

Assert(IEzrObject, IEzrObject, RuntimeResult, Context)

Assertion function to assert conditions.

[WrapMember(false, false)]
public static void Assert(IEzrObject condition, IEzrObject wrapper, RuntimeResult result, Context executionContext)

Parameters

condition IEzrObject

The condition to assert.

wrapper IEzrObject

Reference to the caller.

result RuntimeResult

Reference to the current RuntimeResult.

executionContext Context

Reference to the current execution context.

Remarks

ezr² errors: EzrAssertionError if the condition is not met.

Clear()

Basic console clear function. Implements System.Console.Clear().

[WrapMember(false, false)]
public static void Clear()

Copy(IEzrMutableObject, RuntimeResult)

Creates a copy of an IEzrMutableObject. Uses DeepCopy(RuntimeResult).

[WrapMember(false, false)]
public static IEzrObject Copy(IEzrMutableObject toCopy, RuntimeResult result)

Parameters

toCopy IEzrMutableObject

The object to copy.

result RuntimeResult

Reference to the current RuntimeResult.

Returns

IEzrObject

The copy of the object.

Get(IEzrObject?, RuntimeResult)

Basic console input function. Implements System.Console.ReadLine().

[WrapMember(false, false)]
public static string Get(IEzrObject? message, RuntimeResult result)

Parameters

message IEzrObject

The message to display on the console before waiting for user input.

result RuntimeResult

Reference to the current RuntimeResult.

Returns

string

The user's input.

GetContext(IEzrObject, IEzrObject, RuntimeResult, Context)

Returns an EzrDictionary of the references (as <name, object>) contained in the Context of the given object.

[WrapMember(false, false)]
public static IEzrObject GetContext(IEzrObject toGet, IEzrObject wrapper, RuntimeResult result, Context executionContext)

Parameters

toGet IEzrObject

The object to get the context of.

wrapper IEzrObject

Reference to the caller.

result RuntimeResult

Reference to the current RuntimeResult.

executionContext Context

Reference to the current execution context.

Returns

IEzrObject

The content of the object's context.

GetRaw(IEzrObject, IEzrObject, Context)

Wraps the given ezr² object so that the runtime has access to its raw C# object.

[WrapMember(false, false)]
public static EzrObjectWrapper GetRaw(IEzrObject toGet, IEzrObject wrapper, Context executionContext)

Parameters

toGet IEzrObject

The object to wrap.

wrapper IEzrObject

Reference to the caller.

executionContext Context

Reference to the current execution context.

Returns

EzrObjectWrapper

The wrapped object.

Hash(IEzrObject, RuntimeResult)

Basic hash function. Implements ComputeHashCode(RuntimeResult).

[WrapMember(false, false)]
public static int Hash(IEzrObject toHash, RuntimeResult result)

Parameters

toHash IEzrObject

The object to hash.

result RuntimeResult

Reference to the current RuntimeResult.

Returns

int

The hash of the object.

Show(string, string, List<IEzrObject>, IEzrObject, RuntimeResult, Context)

Basic console print function. Implements System.Console.WriteLine().

[WrapMember(false, false)]
public static void Show(string lineEnd, string separator, List<IEzrObject> messages, IEzrObject wrapper, RuntimeResult result, Context executionContext)

Parameters

lineEnd string

Optional line end character(s) to use instead of System.Environment.NewLine.

separator string

Optional separator to separate each message to be printed.

messages List<IEzrObject>

The message(s) to display on the console.

wrapper IEzrObject

Reference to the caller.

result RuntimeResult

Reference to the current RuntimeResult.

executionContext Context

Reference to the current execution context.

Remarks

ezr² errors: EzrMissingRequiredArgumentError if no messages are provided.

ThrowError(IEzrRuntimeError, RuntimeResult)

Basic error throwing function. Implements Failure(IEzrRuntimeError).

[WrapMember(false, false)]
public static void ThrowError(IEzrRuntimeError error, RuntimeResult result)

Parameters

error IEzrRuntimeError

The error to throw.

result RuntimeResult

Reference to the current RuntimeResult.

TypeHashOf(IEzrObject)

Gets the hash ID of the type of an object. Uses HashTag.

[WrapMember(false, false)]
public static int TypeHashOf(IEzrObject toCheck)

Parameters

toCheck IEzrObject

The object to check the type hash of.

Returns

int

The hashed tag of the object.

TypeNameOf(IEzrObject)

Gets the plain text name of the type of an object. Uses TypeName.

[WrapMember(false, false)]
public static string TypeNameOf(IEzrObject toCheck)

Parameters

toCheck IEzrObject

The object to check the type-name of.

Returns

string

The type name of the object.

TypeOf(IEzrObject)

Basic typeof-like function. Uses Tag.

[WrapMember(false, false)]
public static string TypeOf(IEzrObject toCheck)

Parameters

toCheck IEzrObject

The object to check the type of.

Returns

string

The tag of the object.