Skip to content

ejlilley/tplisp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tplisp

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).

Currently supported:

  • Quoting (keyword and single-quote syntax)
  • Eval (eval calls the built-in tpeval() 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)

Not currently supported:

  • Macros
  • Call-with-current-continuation (call/cc)
  • Dotted-tail notation (in quoting and in lambdas)

Extra features:

  • 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 to eval. Similarly, the symbol user-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 is lib.scm, which contains definitions for some common functions (map, fold etc.).

Extra bugs:

  • The various equality operators (eq etc.) are slightly inconsistent and unhelpful at the moment.

About

Tiny Perl Lisp interpreter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published