Skip to main content

REPL

LIPS Scheme REPL (Read Even Print Loop) is a way to interact with running LIPS Scheme session.

Web REPL

Web REPL you can access from Home page or as a bookmarklet use jQuery Terminal and supports those features:

  • syntax highlighting using Prism.js,
  • parentheses matching - when you type close parenthesis it will jump for a split second into it's matching open parenthesis,
  • auto indentation - when you press enter it auto indent and if you copy paste the code it will reformat it.
  • doc string tooltip - when you hover over a symbol it will show the docstring in a tooltip

Node.js REPL

Node.js version of the REPL, also supports syntax highlighting and auto indentation. It also supports paste bracket mode from Node.js (added by Jakub T. Jankiewicz and released in v20.6.0), to properly handle copy-paste of Scheme code.

In the future, the Node.js REPL may also support parentheses matching. It's supported by CLisp and Common Lisp interpreter.

Procedures useful in REPL

There are few procedures useful in the REPL:

  • help - prints doc string for a given procedure, macro, or a variable (see documentation about Doc Strings),
  • apropos - function return list of procedures from environment that match a string or a regex,
  • env - function returns list of symbols which is everything that is inside an environment,
  • dir - function return all properties from an object including those in prototype chain (a class).
  • repr - function return representation of the object as a string, it's inspired by Python. The repr function accepts two arguments the second one is a boolean that indicate if it should work like write or like display. Write will write string with quotes. So if you want the strings inside the string to be quoted use (repr obj #t)

To read more about introspection of LIPS Scheme in REPL, see documentation about Reflection.