GLaDOS Code Snippets
Examples and templates for common patterns
EXAMPLES
Hello World
Basic program structure
Variables & Types
Variable declaration with type annotations
Functions
Function declaration and calling
Lambdas & Closures
Anonymous functions and captured variables
Classes & Objects
Object-oriented programming with classes
Exception Handling
Try-catch blocks for error handling
Pattern Matching
Match expressions for control flow
Lists & Iteration
Working with lists and loops
String Operations
String manipulation with builtins
File I/O
Reading and writing files
Math Operations
Mathematical computations
Higher-Order Functions
Functions as first-class values
Hello World
Basic program structure
def main() -> Int {
print("Hello, GLaDOS!");
return 0;
}