lisp library

Lisp grammar, evaluator, and standard environment.

The code is reasonably complete to run and evaluate reasonably complex programs from the console or the web browser.

For example:

final env = NativeEnvironment();
evalString(lispParser, env, '(print "Hello World")');

Classes

Cons
The basic data structure of LISP.
Environment
Environment of bindings.
LispParserDefinition
LISP parser definition that directly creates typed Lisp AST structures.
Name
An unique symbolic name.
NativeEnvironment
Quote
A quoted datum.
StandardEnvironment
The standard library.

Properties

lispParser → Parser<List>
The standard lisp parser.
final
printer ↔ Printer
Default printer to output text on the console.
getter/setter pair

Functions

eval(Environment env, dynamic expr) → dynamic
The evaluation function.
evalArguments(Environment env, dynamic args) → dynamic
The arguments evaluation function.
evalList(Environment env, dynamic expr) → dynamic
Evaluate a cons of instructions.
evalString(Parser parser, Environment env, String script) → dynamic
Reads and evaluates a script.

Typedefs

Lambda = dynamic Function(Environment env, dynamic args)
Lambda function type in the Dart world.
Printer = void Function(Object? object)
Type of printer function to output text on the console.