Enhanched exception formatting
ENHANCHED: Better REPL interaction and stacktraces
Update README.md
A Scheme Lisp interpreter implemented in SWI-Prolog.
Run make
to build the eshellisp
interpreter:
$ make
% Disabled autoloading (loaded 34 files)
% Disabled autoloading (loaded 20 files)
% Disabled autoloading (loaded 0 files)
$ ./eshellisp -h
eshellisp [-h] PATH
--help -h boolean=false Print usage information
Simply point eshellisp
at a Scheme file to run it:
$ cat scheme/repl.scm
(define repl () (write (eval (read))) (repl))
(repl)
$ ./eshellisp scheme/repl.scm
% (+ 1 2)
% 3
% (cdr '(a . (b . (c . d))))
% (b c . d)
% (define ++ (n) (+ 1 n))
% '++
% (++ (++ 0))
% 2
% (eval '(++ (- 1)))
% 0
% ^C^C
$ make check
./eshellisp test/suite.scm
% (#t . #t)
% (#f . #f)
% ('#f . #f)
% ((not #t) . #f)
% ((not 3) . #f)
% ((boolean=? #t #t) . #t)
% ((boolean=? #t #f) . #f)
% ('(a b c d) a b c d)
% ('(a b c . d) a b c . d)
% ((pair? '(a . b)) . #t)
% ((pair? '(a b c)) . #t)
% ((pair? '()) . #f)
% ((cons 'a '()) a)
% ((cons '(a) '(b c d)) (a) b c d)
% ((cons 'a 3) a . 3)
% ((cons '(a b) 'c) (a b) . c)
% ((car '(a b c)) . a)
% ((car '((a) b c d)) a)
% ((car '(1 . 2)) . 1)
% ((cdr '((a) b c d)) b c d)
% ((cdr '(1 . 2)) . 2)
echo "(+ 1 2)" | ./eshellisp scheme/read_eval_write.scm
% ((eval (read)) . 3)
For questions, requests, patches, please write to
~eshel/dev@lists.sr.ht specifying the name of this repository in
mail subject, e.g. [PATCH eshellisp] fix it
.