Dana provides a number of "system calls" in its runtime. These calls provide a range of low-level functionality.
dana.serial(Data x)
This returns a writable array of type byte[]. It only works on Data instances that contain fields of primitive types.
dana.sub(array, int startIndex, int endIndex)
This returns an array which has the specified sub-range from the given input array, where the start and end index are both inclusive; the resulting array will have length (endIndex-startIndex)+1. The resulting array has a shallow copy of the input array content, such that writing to cells of the resulting array affects the values in the original array.
dana.getIDC()
This returns an IDC of the Dana runtime. This IDC can then be queried for further interfaces that the runtime provides (such as io.Output).
int[] dana.getDimensions(array)Gets the number of dimensions, and the length of each dimension, for a dynamically-instantiated array.
dana.setDimensions(array, int dimensions[])Sets the number of dimensions, and the length of each dimension, for a dynamically-instantiated array.
dana.pauseObject(IDC com, Object o)
Typically used as part of runtime adaptation, this prevents further function calls from entering the given object, instead holding those calls at the point of invocation. The supplied component reference must be the one from which object is currently sourced.
dana.resumeObject(Object o)
Typically used as part of runtime adaptation, this re-enables function calls to enter the given object, and also resumes any previous held calls.
dana.rewireObject(Object x, Object y)
Typically used as part of runtime adaptation, this adapts object x such that it uses the implementation (and internal state) of object y. This operation returns a third object which represents object x as known by its previous implementation before it was rewired.
dana.waitForObject(Object x)
Typically used as part of runtime adaptation, this waits for all in-progress function calls in object x to finish.
dana.waitForObjectThreads(Object x)
Typically used as part of runtime adaptation, this waits for asynchronous threads to finish in the object.