My lisp interpreter in Go. Inspired by scheme syntax. See :
- https://web.mit.edu/scheme/scheme_v9.2/doc/mit-scheme-ref/index.html (prefered)
- https://www.gnu.org/software/guile/manual/guile.html#SEC_Contents
- https://www.scheme.com/tspl4/
Examples lisp/scheme files are in the examples folder.
You can run an example directly from the command line with :
go run . -l "examples/counter.scm"
You can list the available keywords built-in with * (keywords )*.
You can display help on one or more keywoards ( kw1, kw2 ...) by evaluationg ( help kw1 kw2 )
New keywords :
- ( debug value ) sets the debug/trace level
- ( join-path p1 p2 ... ) constructs a path from path components, using system file separator
- ( load fullPathName ) loads and evaluate a file
- ( file-sep ) retuns the system file separator
- ( version ) gets the current version of the interpreter
- ( help keyword ) : display online help for keyword
Extended behaviour vs standard :
- ( display x1 x2 ... ) : display can display zero, one or more Terms.
- Numbers are integer or rationnal.
- The decimal point is not accepted.
- Rational are written 8/3. ( no space ! )
- Rational are immutable and always normalized, with a positive denominator.
- Zero is 0/1, while 1/0 represents NaN.
- string litterlas are quoted with double quotes (")
- there is no escaping, string litteral may contain newline directly
Error is a specific type that can be returned from evaluation.