-
Notifications
You must be signed in to change notification settings - Fork 0
API Host ClrGetterDelegate
Liu.Yandong.Hanks edited this page Aug 21, 2026
·
3 revisions
Advanced delegate shape for host-backed dynamic getters.
Namespace: AuroraScript.Runtime.Types. Kind: delegate.
Back to .NET Host API Reference
ClrGetterDelegate computes a property value on demand. The runtime passes the object being read and a ref result slot, so the host can return live state instead of a value captured earlier. Wrap a delegate in BondingGetter to expose it as a script-readable property.
A minimal use of ClrGetterDelegate.
ClrGetterDelegate getAnswer = (
ScriptObject target,
ref ScriptDatum result) =>
{
result = ScriptDatum.FromNumber(42);
};void Invoke(ScriptObject @object, ref ScriptDatum result)Delegate signature invoked by the runtime on each property read.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
object |
ScriptObject |
Yes | Object the property is read from. |
result |
ref ScriptDatum |
Yes | Slot receiving the read value. |
Returns
None. The read value is written to result.
Behavior
The callback runs on every read, so keep it cheap and free of side effects.
ClrGetterDelegate now = (
ScriptObject target,
ref ScriptDatum result) =>
{
result = ScriptDatum.FromDate(DateTime.UtcNow);
};AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License