Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.
itevie edited this page Aug 23, 2023 · 1 revision

Types in Zephyr

Types in the language have not been perfected yet, such as numbers (ints and floats) and arrays, though they are mostly functional.

Useage in variables

To use types in variables, you can prefix the variable name with the type, like C#:

let string a = "Hello World"; // a is of type string, and will be enforced
let b = "Hello World"; // b is of type string, though reassigning type check will not be re-enforced
let string? c = "Hello World" // c i sof type string, type checking is enforced but c is nullable
c = null; // Valid

let string[] c = []; // Not valid at the moment, type must be "any" for arrays

All of the types

Here are the list of types:

  • string
  • int
  • bool
  • float
  • array - Array of different values
  • object - key-value dictionary where key is string and key is anything
  • enummerable - This is an internal type, though can still be created, e.g. range expresisons
Clone this wiki locally