Skip to main content Svelte Highlight v7.21.1

Verse language preview

1. Counter device

a class definition, specifiers, and a loop
horizon-dark
<# a simple counter class #>
counter_device := class(creative_device):
    Count : int = 0

    OnBegin<override>()<suspends> : void =
        loop:
            Count += 1

    GetCount<public>()<decides><transacts> : int =
        Count
atom-one-dark
<# a simple counter class #>
counter_device := class(creative_device):
    Count : int = 0

    OnBegin<override>()<suspends> : void =
        loop:
            Count += 1

    GetCount<public>()<decides><transacts> : int =
        Count
github-dark
<# a simple counter class #>
counter_device := class(creative_device):
    Count : int = 0

    OnBegin<override>()<suspends> : void =
        loop:
            Count += 1

    GetCount<public>()<decides><transacts> : int =
        Count
dracula
<# a simple counter class #>
counter_device := class(creative_device):
    Count : int = 0

    OnBegin<override>()<suspends> : void =
        loop:
            Count += 1

    GetCount<public>()<decides><transacts> : int =
        Count
nord
<# a simple counter class #>
counter_device := class(creative_device):
    Count : int = 0

    OnBegin<override>()<suspends> : void =
        loop:
            Count += 1

    GetCount<public>()<decides><transacts> : int =
        Count
github
<# a simple counter class #>
counter_device := class(creative_device):
    Count : int = 0

    OnBegin<override>()<suspends> : void =
        loop:
            Count += 1

    GetCount<public>()<decides><transacts> : int =
        Count

2. Editable properties

the @editable attribute
horizon-dark
@editable
Var Health : int = 100

@editable
Var Name : string = "Player"
atom-one-dark
@editable
Var Health : int = 100

@editable
Var Name : string = "Player"
github-dark
@editable
Var Health : int = 100

@editable
Var Name : string = "Player"
dracula
@editable
Var Health : int = 100

@editable
Var Name : string = "Player"
nord
@editable
Var Health : int = 100

@editable
Var Name : string = "Player"
github
@editable
Var Health : int = 100

@editable
Var Name : string = "Player"

3. Failable expressions

the ? failable suffix and optional access
horizon-dark
FindPlayer(Name : string)<decides> : player =
    for (P : GetPlayspace().GetPlayers(), P.GetName[] = Name):
        P
atom-one-dark
FindPlayer(Name : string)<decides> : player =
    for (P : GetPlayspace().GetPlayers(), P.GetName[] = Name):
        P
github-dark
FindPlayer(Name : string)<decides> : player =
    for (P : GetPlayspace().GetPlayers(), P.GetName[] = Name):
        P
dracula
FindPlayer(Name : string)<decides> : player =
    for (P : GetPlayspace().GetPlayers(), P.GetName[] = Name):
        P
nord
FindPlayer(Name : string)<decides> : player =
    for (P : GetPlayspace().GetPlayers(), P.GetName[] = Name):
        P
github
FindPlayer(Name : string)<decides> : player =
    for (P : GetPlayspace().GetPlayers(), P.GetName[] = Name):
        P