GLaDOS
  • Home
  • 🌴Introduction
    • Installation
    • Basic Code example
    • Syntax Overview
  • 🤖Developpers
    • Parsing
    • Verbose Mode
  • ✨Features
    • Types
    • Operators
    • Lists
    • Includes
    • Syntactic Sugar
    • Loops
    • Conditions
    • Internal Functions
    • Recursivity
    • Prototypes
    • Error handling
    • Comments
    • Scopes
  • 📚Libraries
    • Mathematics
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Features

Syntactic Sugar

GoMelan supports different kind of syntactic sugar (shorter ways of writing the same code).

List of supported syntax

  • var++ and var += 1 -> add 1 to var

  • var-- and var -= 1 -> substract 1 from var

  • for (<variable-declaration> ; <condition> ; <variable-update>) for loop simplification

fn main() -> Bool
{
    a: Float = 0.5;
    
    for (i: Float = 0.0; i <= a; i += 0.1) {
        if (i > a) {
            return false;
        }
    }
    return true;
}

Output:

true
  1. Declare one Float variable.

  2. Loop while i is lower or equal to a.

  3. If there is no problem, the code returns True and otherwise False.

PreviousIncludesNextLoops

Last updated 1 year ago

Was this helpful?

✨