Skip to content
Marcel Guinhos edited this page Sep 16, 2023 · 5 revisions

Welcome to the Gullian wiki!

Basic types

bool int float ptr str std.vec.Vector

Type declarations

This is how you declare data structures in Gullian

enum Genre {
    Mistery,
    Action,
    Romance
}

struct Book {
    genre: Genre,
    title: str,
    author: str
}

struct Hq {
    genre: Genre,
    title: str,
    author: str
}

union BookAndHq {
    book: Book, 
    hq: Hq
}

Function Declarations

fun add(a: int, b: int) : int {
    return a + b
}

# You can also override functions
fun add(a: float, b: float) : int {
    return a + b
}