ScratchLisp

  scripts
  sprites
See inside
Instructions

Enjoy Lisp!

<<<Example>>>
(car '(a b c))
(cons 1 (cons 2 (cons 3 ())))
(defun fact (n) (if (eq n 0) 1 (* n (fact (- n 1)))))
(defun fib (n) (if (eq n 1) 1 (if (eq n 0) 1 (+ (fib(- n 1)) (fib(- n 2))))))
(defun gen (n) (lambda (m) (setq n (+ n m))))

<<<Functions>>>
car
cdr
cons
eq (this can compare numbers)
atom
+, -, *, /, mod (they accept exact two numbers)

<<<Special Forms>>>
quote
if
lambda
defun
setq (this can define a global variable)

<<<Features>>>
GC: This implementation has stop-the-world mark sweep GC.
Numeric tower: This implementation supports only non-negative integer.
Tail recursion optimization: NOT supported.
Reader: This implementation doesn't accept a dotted list like (1 . 2). Please use cons instead.

Notes and Credits

Shared: 15 Mar 2014 Modified: 15 Jun 2014
Favorite this project 43
Love this project 43
Total views 2507
View the remix tree  2
  
More projects by zick_minoh