Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 862 Bytes

File metadata and controls

32 lines (21 loc) · 862 Bytes

Allowed Casts In Glint

[Explicit] Struct to Fixed Array of Byte

A struct assigns an identifier to each member. Each member must take up a unique place in the computer’s memory. A computer’s memory is addressed via units of multiple bits called bytes. So, a struct is a named layout of memory, of bytes. That means that any struct is convertible (explicitly) to the underlying bytes that it represents.

In Glint:

;; TODO: not implemented

[Implicit] Fixed Array to Dynamic Array

[Implicit] Dynamic Array to Array View

[Implicit] Fixed Array to Array View

[Implicit] Enum to Underlying

[Implicit] Boolean <-> Integer

An integer is convertible to a boolean implicitly, and vice versa.

(0 + true) = 1;
x :: 0;
y :: 1;
if x + y, 1 else 0;