Class EzrBuiltinFunctions
- Namespace
- EzrSquared.Runtime.Types.Builtins
- Assembly
- ezrSquared-lib.dll
All built-in functions in ezr².
public static class EzrBuiltinFunctions
- Inheritance
-
objectEzrBuiltinFunctions
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
IEzrObjectThe condition to assert.
wrapper
IEzrObjectReference to the caller.
result
RuntimeResultReference to the current RuntimeResult.
executionContext
ContextReference 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
IEzrMutableObjectThe object to copy.
result
RuntimeResultReference 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
IEzrObjectThe message to display on the console before waiting for user input.
result
RuntimeResultReference 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
IEzrObjectThe object to get the context of.
wrapper
IEzrObjectReference to the caller.
result
RuntimeResultReference to the current RuntimeResult.
executionContext
ContextReference 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
IEzrObjectThe object to wrap.
wrapper
IEzrObjectReference to the caller.
executionContext
ContextReference 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
IEzrObjectThe object to hash.
result
RuntimeResultReference 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
stringOptional line end character(s) to use instead of System.Environment.NewLine.
separator
stringOptional separator to separate each message to be printed.
messages
List<IEzrObject>The message(s) to display on the console.
wrapper
IEzrObjectReference to the caller.
result
RuntimeResultReference to the current RuntimeResult.
executionContext
ContextReference 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
IEzrRuntimeErrorThe error to throw.
result
RuntimeResultReference 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
IEzrObjectThe 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
IEzrObjectThe object to check the type-name of.
Returns
- string
The type name of the object.
TypeOf(IEzrObject)
[WrapMember(false, false)]
public static string TypeOf(IEzrObject toCheck)
Parameters
toCheck
IEzrObjectThe object to check the type of.
Returns
- string
The tag of the object.