Skip to content

Using the REPL

Rohan Singh edited this page May 5, 2017 · 5 revisions

The Mond REPL (read-eval-print-loop) allows you to quickly test scripts by writing them line-by-line into a console.

There are a few important things to know when using the REPL:

  • Semicolons are still required
  • You can display values by returning them
  • You can prefix lines with = to return a value
  • All declarations that aren't in a fun or seq will be put into the global object
  • Undefined variables will resolve to values in the global object

Usage

Syntax highlighting can be disabled by passing --no-color to it. The debugger can be enabled on port 1597 by passing --debug.

Script files can be run by passing the filename to it:

Mond.Repl.exe fizzbuzz.mnd