Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 1.05 KB

REFERENCE.md

File metadata and controls

71 lines (52 loc) · 1.05 KB

Language Reference

Quick syntax reference for ProXPL.

Variables and Declarations

let x = 42;                    // Mutable
const PI = 3.14;               // Immutable
let count: int = 0;            // With type annotation

Control Flow

if (condition) { } else { }
while (condition) { }
for (let i = 0; i < 10; i++) { }
switch (val) { case 1: ... default: ... }
break; continue;

Functions

func name(params) { body }
async func asyncName(params) { body }

Classes and OOP

class Name {
    func method() { }
}
class Child extends Parent { }

Intent-Oriented

intent Name(params);
resolver Name matches Intent { }

Context-Oriented

context Name {
    layer Name { func ... }
}
activate ContextName { ... }

Modules

use std.module;
import ... from ...;

Error Handling

try { } catch (e) { } finally { }

Status: Stable See Also: Specification, Built-in Functions