tplisp
is a minimalistic interpreter of an extremely limited (at the
moment) subset of R5RS Scheme. The internals are very lisp-y in their
own right, and not at all object-oriented (for some reason).
- Quoting (keyword and single-quote syntax)
- Eval (
eval
calls the built-intpeval()
directly) - Proper lexically scoped environments & closures
- Vectors (keyword and hash syntax)
apply
, and various other built-ins- tail recursion optimisation
- a type system (not fully worked out yet)
- Macros
- Call-with-current-continuation (call/cc)
- Dotted-tail notation (in quoting and in lambdas)
dump
calls Data::Dumper::Dumper on its argument. Helpful for debugging.perl
evaluates its first argument (a string) as verbatim Perl code, returning the result in the same way as any other procedure (amazing!). It cannot include quotes, however, and the escaping isn’t working spectacularly.- Calling
(current-environment)
returns the current environment (unsurprisingly), suitable for passing as the second argument toeval
. Similarly, the symboluser-initial-environment
is the top level, global environment. - You can use λ directly instead of
lambda
. This lisp implementation is streets ahead of the competition now! - The command-line option
--load
specifies a file containing expressions to be evaluated before you are dropped into the repl. Including islib.scm
, which contains definitions for some common functions (map
,fold
etc.).
- The various equality operators (
eq
etc.) are slightly inconsistent and unhelpful at the moment.