Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 3.09 KB

intrinsics.md

File metadata and controls

12 lines (8 loc) · 3.09 KB
description
Intrinsics are low-level operations that are natively supported in REDscript.

Intrinsics

IntrinsicTypeDescription
Equals(A, A) -> BoolEquality check (for references, enums, strings and booleans)
NotEquals(A, A) -> BoolInequality check (same as above)
IsDefined

(ref<A>) -> Bool

(wref<A>) -> Bool

Null check
ToString(A) -> StringString conversion
EnumInt(A) -> Int32Enum-to-Int32 conversion
IntEnum(Int32) -> AInt32-to-enum conversion
ToVariant(A) -> VariantVariant constructor
FromVariant(Variant) -> AVariant extractor (fails at runtime if the type does not match)
ArraySize

([A]) -> Int32

([A; N]) -> Int32

ArrayPush([A], A) -> VoidPush item on stack (order is LIFO).
ArrayPop([A]) -> APop item from stack (order is LIFO).
ArrayClear([A]) -> Void
ArrayResize([A], Int32) -> Void
ArrayFindFirst

([A], A) -> Int32

([A; N], A) -> Int32

ArrayFindLast

([A], A) -> Int32

([A; N], A) -> Int32

ArrayContains

([A], A) -> Bool

([A; N], A) -> Bool

ArrayCount

([A], A) -> Int32

([A; N], A) -> Int32

ArraySort([A]) -> VoidOnly accepts arrays of primitives
ArrayInsert([A], Int32, A) -> Void
ArrayRemove([A], A) -> Bool
ArrayGrow([A], Int32) -> Void
ArrayErase([A], Int32) -> Void
ArrayLast

([A]) -> A

([A; N]) -> A

Legend:

  • [A] - array of A
  • [A; N] static array of A with size N