Skip to content

jakubwro/lisp-in-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lisp in Python

Build Status Coverage Status

Just a simple Lisp with macros, quotations and tail calls.

Example

To run REPL use run-repl.sh script

$./run-repl.sh

Welcome to the REPL!
Press CTRL+C to quit.

lisp-in-python> (+ 1 (+ 2 3))
6
lisp-in-python> (def! fib (fn* (N)
                	(if (= N 0)
                		1
                		(if (= N 1)
                			1
                			(+ (fib (- N 1)) (fib (- N 2)))))))
<function>
lisp-in-python> (fib 8)
34
lisp-in-python> (fib 11)
144
lisp-in-python> (defmacro! unless (fn* (pred a b) (quasiquote (if (unquote pred) (unquote b) ( unquote a)))))
<function>
lisp-in-python> (unless false 1 2)
1
lisp-in-python> (unless true 1 2)
2
lisp-in-python> (macroexpand (unless true 1 2))
(if true 2 1)

Resources

I was inspired by these projects:

About

A simple Lisp in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published