Scheme interpreter
build from source
git clone https://github.com/garlic0x1/scheme-interpreter.git
cd scheme-interpreter
cargo install --path .
scheme-interpreter
Commands: eval evaluate a string run run a file as a program repl start a REPL help Print this message or the help of the given subcommand(s) Options: -h, --help Print help -V, --version Print version
A list of what is done (not exhaustive)
- eval
(eval (quote (println {:hi "world"})))
evaluate Edn as lisp
- load
(load "test.scm")
Evaluate a file
- lambda
(lambda [x] (println x))
Create an anonymous function
- def
(def x "var")
Define in global namespace
- if
(if pred? then else)
If statement, returns branch. nil, false, 0, “”, etc are falsy
- do
(do (println "1") (println "2"))
Evaluate multiple exprs, return last
- quote
(quote (1 2 3))
Return list without evaluating
- conj
- cons
- car
- cdr
- =
- +
- *
- /
- mod
- int
- str
- type
- read
- slurp
- println
- dbg