~eshel/eshellisp

Lisp interpreter implemented in SWI-Prolog
2b52b2e9 — Eshel Yaron 2 years ago
Enhanched exception formatting
1a56b974 — Eshel Yaron 2 years ago
ENHANCHED: Better REPL interaction and stacktraces
384ebdea — Eshel Yaron 2 years ago
Update README.md

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~eshel/eshellisp
read/write
git@git.sr.ht:~eshel/eshellisp

You can also use your local clone with git send-email.

#eshellisp

builds.sr.ht status

A Scheme Lisp interpreter implemented in SWI-Prolog.

#Building

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

#Usage

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

#Testing

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

#Contributing

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.