Primitives
The primitives in the Jane language include:
- Numbers:
- Integers:
- Signed:
- i8 (alias sbyte)
- i16 (alias short)
- i32 (alias int)
- i64 (alias long)
- i128 (alias reallylong)
- Unsigned:
- u8 (alias byte)
- u16 (alias ushort)
- u32 (alias uint)
- u64 (alias ulong)
- u128
- Signed:
- Floating Point Numbers:
- f32 (alias float, single)
- f64 (alias double)
- Integers:
- chr (character)
- str (string)
- bool (boolean)
- abyss (aliases: void, null, undefined, nil)
These primitives are passed by value.
Compound types
Compound types are comprised of the previously mentioned ones:
Tuples: (T1 T2 T3) Arrays: [T1 T1 T1]
Tuples are value-types, arrays are reference-types.
Declaration
// inferred types:
let counter = 0 // declares an i32 and sets it to 0
let text = "hello" // declares a str and sets it to "hello"
let pi = 'π' // declares a chr and sets it to π
// suffix notation:
let i = 76u64
let j = -6i8
// no inferring
let k: i32
let l: str
let m: T // generally
// abyssable
let n: str?
if n? {
// Amazing abyss check
}
else {
// :(
}
more on abyssables: Abyssable