Skip to content
forked from irori/lazyk-lisp

A toy Lisp interpreter in Lazy K.

Notifications You must be signed in to change notification settings

helvm/lazyk-lisp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

LazyK-Lisp

A toy Lisp interpreter in Lazy K.

How to Use

$ lazyk lisp.lazy
> (car '(a b c))
a
> (cdr '(a b c))
(b c)
> (cons 1 (cons 2 (cons 3 ())))
(1 2 3)
> (defun fact (n) (if (eq n 0) 1 (* n (fact (- n 1)))))
fact
> (fact 8)
40320
> (defun fib (n) (if (eq n 1) 1 (if (eq n 0) 1 (+ (fib (- n 1)) (fib (- n 2))))))
fib
> (fib 10)
89
> (set 'count 0)
0
> (defun incr () (set 'count (+ count 1)))
incr
> (incr)
1
> (incr)
2
> (incr)
3

Builtin Functions

  • car
  • cdr
  • cons
  • eq (can compare numbers)
  • atom
  • +, -, *, /, mod
  • set

Special Forms

  • quote
  • if
  • lambda
  • defun

Links

About

A toy Lisp interpreter in Lazy K.

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages

  • Haskell 100.0%