Skip to content

Operators without arguments

Values that the compiler gives to the program.

Every program can use these operators. No import is necessary.

Operator Arguments Gives
create_immutable_array [T]
create_immutable_hash [K
current_directory string
error_msg string
install_directory string
M_PI double
poll_keypress string
random double
shell_arg_cnt int
wall_clock_ms double

Target support marks

  • Own template
  • Default template
  • No template

The operator works for a target with an own template and for a target with the default template. The default template is the * entry of the definition: it writes the same code for every target that has no template of its own. A target with no template writes no code, and a program that uses the operator does not compile for that target.

create_immutable_array

(create_immutable_array) → [T]

immutable operators, maybe used by the compiler... https://github.com/Workiva/go-datastructures

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: no template
  • Python: no template
  • Java: no template
  • Kotlin: no template
  • Dart: no template
  • Swift: no template
  • C#: no template
  • C++: no template
  • PHP: no template
  • Scala: no template

Definition: compiler/Lang.rgr, line 1312

create_immutable_hash

(create_immutable_hash) → [K

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: no template
  • Python: no template
  • Java: no template
  • Kotlin: no template
  • Dart: no template
  • Swift: no template
  • C#: no template
  • C++: no template
  • PHP: no template
  • Scala: no template

Definition: compiler/Lang.rgr, line 1318

current_directory

(current_directory) → string

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: default template
  • Rust: own template
  • Python: own template
  • Java: default template
  • Kotlin: default template
  • Dart: own template
  • Swift: default template
  • C#: own template
  • C++: own template
  • PHP: default template
  • Scala: default template

Definition: compiler/Lang.rgr, line 3191

error_msg

(error_msg) → string

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: own template
  • Python: own template
  • Java: own template
  • Kotlin: own template
  • Dart: own template
  • Swift: own template
  • C#: own template
  • C++: own template
  • PHP: own template
  • Scala: own template

Definition: compiler/Lang.rgr, line 5656

install_directory

(install_directory) → string

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: own template
  • Python: own template
  • Java: default template
  • Kotlin: own template
  • Dart: own template
  • Swift: default template
  • C#: own template
  • C++: own template
  • PHP: default template
  • Scala: default template

Definition: compiler/Lang.rgr, line 2876

M_PI

(M_PI) → double

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: own template
  • Python: own template
  • Java: own template
  • Kotlin: own template
  • Dart: own template
  • Swift: own template
  • C#: own template
  • C++: own template
  • PHP: own template
  • Scala: own template

Definition: compiler/Lang.rgr, line 1325

poll_keypress

(poll_keypress) → string

Poll for keypress (non-blocking, for use in game loops) Returns empty string if no key is available

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: own template
  • Python: own template
  • Java: default template
  • Kotlin: own template
  • Dart: default template
  • Swift: own template
  • C#: default template
  • C++: own template
  • PHP: default template
  • Scala: default template

Definition: compiler/Lang.rgr, line 11166

random

(random) → double

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: own template
  • Python: own template
  • Java: own template
  • Kotlin: own template
  • Dart: own template
  • Swift: own template
  • C#: own template
  • C++: own template
  • PHP: own template
  • Scala: own template

Definition: compiler/Lang.rgr, line 712

shell_arg_cnt

(shell_arg_cnt) → int

return the number of arguments for command line utility

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: own template
  • Python: own template
  • Java: own template
  • Kotlin: own template
  • Dart: own template
  • Swift: own template
  • C#: own template
  • C++: own template
  • PHP: own template
  • Scala: no template

Definition: compiler/Lang.rgr, line 1591

wall_clock_ms

(wall_clock_ms) → double

Wall-clock milliseconds since the Unix epoch, as a DOUBLE so sub-millisecond fractions are preserved. Used by embedders that want Date.now() / performance.now() to advance (e.g. Octane); the TS engine's default hostNowMs stays frozen for reproducible conformance. Integer-ms casts (duration_cast<milliseconds>, Date.now(), UnixMilli) floor every delta to 1 ms and pin Octane scores to a few discrete buckets — keep the fractional form.

Target support

  • JavaScript: own template
  • TypeScript: own template
  • Go: own template
  • Rust: own template
  • Python: own template
  • Java: own template
  • Kotlin: own template
  • Dart: own template
  • Swift: own template
  • C#: own template
  • C++: own template
  • PHP: own template
  • Scala: own template

Definition: compiler/Lang.rgr, line 3509

Ranger 3.5.1 · commit f323fd4 · development build