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 (
evalcalls 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)
dumpcalls Data::Dumper::Dumper on its argument. Helpful for debugging.perlevaluates 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-environmentis 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
--loadspecifies 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,foldetc.).
- The various equality operators (
eqetc.) are slightly inconsistent and unhelpful at the moment.