Documentation home / Language Reference
Language Reference
GSVE Core Built-in Functions
Reference for print, show, interact, len, str, num, type, range, collection helpers, cloning, merging and class helpers.
Output and interactive input
print(...values)prints arguments separated by spaces and ends the line.show(...values)is an additional output surface.interact(prompt?)writes an optional prompt, reads one standard-input line and returns a string; returns null at end-of-file.
define name = interact("Your name? ");
print("Hello, " + name);Type and conversion
| Built-in | Behavior |
|---|---|
len(value) | Length of a string, array or object; otherwise zero. |
str(value) | Converts a value to its string representation. |
num(value) | Converts through the runtime numeric conversion helper. |
type(value) | Returns runtime category: null, number, bool, string, array, object, function or iterator. |
Sequences and collections
range(stop),range(start, stop),range(start, stop, step): creates an array; stop is exclusive; capped at 100,000 values.push(array, value): appends and returns new length.pop(array): removes and returns the last value, or null when empty.keys(object)andvalues(object): return arrays in insertion order; non-object inputs return empty arrays.contains(collection, value): substring, array item or object key membership test.
Object and class helpers
clone(value): recursive array/object clone.merge(target, source): shallow object merge.has(object, key): own-key check.class(fields, methods, parent?),new(ClassName),instanceof(instance, ClassName): lightweight class descriptor and inheritance helpers.
