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
conditionIEzrObjectThe condition to assert.
wrapperIEzrObjectReference to the caller.
resultRuntimeResultReference to the current RuntimeResult.
executionContextContextReference 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
toCopyIEzrMutableObjectThe object to copy.
resultRuntimeResultReference 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
messageIEzrObjectThe message to display on the console before waiting for user input.
resultRuntimeResultReference 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
toGetIEzrObjectThe object to get the context of.
wrapperIEzrObjectReference to the caller.
resultRuntimeResultReference to the current RuntimeResult.
executionContextContextReference 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
toGetIEzrObjectThe object to wrap.
wrapperIEzrObjectReference to the caller.
executionContextContextReference 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
toHashIEzrObjectThe object to hash.
resultRuntimeResultReference 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
lineEndstringOptional line end character(s) to use instead of System.Environment.NewLine.
separatorstringOptional separator to separate each message to be printed.
messagesList<IEzrObject>The message(s) to display on the console.
wrapperIEzrObjectReference to the caller.
resultRuntimeResultReference to the current RuntimeResult.
executionContextContextReference 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
errorIEzrRuntimeErrorThe error to throw.
resultRuntimeResultReference 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
toCheckIEzrObjectThe 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
toCheckIEzrObjectThe 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
toCheckIEzrObjectThe object to check the type of.
Returns
- string
The tag of the object.