Integer Prototypes
Integer values expose mutation helpers.
let count = 1
count.increment()
println(count)Current Literal Limitation
Section titled “Current Literal Limitation”Prototype calls currently work reliably on values stored in variables.
let s = "string"
println(s.length())Calling prototype methods directly on literals is currently limited by AST/parser behavior.
// Currently may not work:println("string".length())Prefer assigning the literal to a variable first.
let text = "string"
println(text.length())Methods
Section titled “Methods”| Method | Returns | Description |
|---|---|---|
increment() | void | Increments the integer by 1. |
decrement() | void | Decrements the integer by 1. |
Example
Section titled “Example”let count = 0
count.increment()count.increment()count.decrement()
println(count)