frozenbears / Lisc

A toy Lisp written in Objective-C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lisc

Lisc is a toy Lisp interpreter written in Objective-C, loosely based on Peter Norvig's Lispy. Originally conceived as a hackday project, Lisc is nowhere near full featured enough to be useful for serious development, but it does serve as an interesting example of how to build a language interpreter from scratch, as well as the peculiar elegance in how Lisp-like languages can be bootstrapped from a small core of expressions.

Currently the language supports some basic arithmetic, strings, conditionals, list operations, lambdas, and lexically scoped variable binding.

Examples

(define foo 
  (lambda (x) (+ x 20)))   
(foo 20)
> 40
(first ("foo" "bar" "baz"))
> "foo"
(if (is "foo" "foo")
  (print "equal")
  (print "not equal"))
> "equal"
(if (is "foo" "bar")
  (print "equal")
  (print "not equal"))
> "not equal"

About

A toy Lisp written in Objective-C

License:MIT License


Languages

Language:Objective-C 100.0%