> For the complete documentation index, see [llms.txt](https://solaartw.gitbook.io/developer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://solaartw.gitbook.io/developer/documentation/utilities/redscript/reference-sheets/language-features/intrinsics.md).

# Intrinsics

| Intrinsic        | Type                                | Description                                                     |
| ---------------- | ----------------------------------- | --------------------------------------------------------------- |
| `Equals`         | `(A, A) -> Bool`                    | Equality check (for references, enums, strings and booleans)    |
| `NotEquals`      | `(A, A) -> Bool`                    | Inequality check (same as above)                                |
| `IsDefined`      | `(ref<A>) -> Bool(wref<A>) -> Bool` | Null check                                                      |
| `ToString`       | `(A) -> String`                     | String conversion                                               |
| `EnumInt`        | `(A) -> Int32`                      | Enum-to-Int32 conversion                                        |
| `IntEnum`        | `(Int32) -> A`                      | Int32-to-enum conversion                                        |
| `ToVariant`      | `(A) -> Variant`                    | Variant constructor                                             |
| `FromVariant`    | `(Variant) -> A`                    | Variant extractor (fails at runtime if the type does not match) |
| `ArraySize`      | `(array<A>) -> Int32`               | ​                                                               |
| `ArrayPush`      | `(array<A>, A) -> Void`             | ​                                                               |
| `ArrayPop`       | `(array<A>) -> A`                   | ​                                                               |
| `ArrayClear`     | `(array<A>) -> Void`                | ​                                                               |
| `ArrayResize`    | `(array<A>, Int32) -> Void`         | ​                                                               |
| `ArrayFindFirst` | `(array<A>, A) -> A`                | ​                                                               |
| `ArrayFindLast`  | `(array<A>, A) -> A`                | ​                                                               |
| `ArrayContains`  | `(array<A>, A) -> Bool`             | ​                                                               |
| `ArrayCount`     | `(array<A>, A) -> Int32`            | ​                                                               |
| `ArrayInsert`    | `(array<A>, Int32, A) -> Void`      | ​                                                               |
| `ArrayRemove`    | `(array<A>, A) -> Bool`             | ​                                                               |
| `ArrayGrow`      | `(array<A>, Int32) -> Void`         | ​                                                               |
| `ArrayErase`     | `(array<A>, Int32) -> Void`         | ​                                                               |
| `ArrayLast`      | `(array<A>) -> A`                   | ​                                                               |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://solaartw.gitbook.io/developer/documentation/utilities/redscript/reference-sheets/language-features/intrinsics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
