Skip to content

barakyo/elisper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elisper

Build Status

An experimental implementation of a subset of lisp in Elixir.

This was mainly a fun project based off of the blog post, Lisp In Your Own Language, by Dan Prince.

Some things that are supported:

Evaluation

iex(2)> Elisper.eval([:+, 1, 1])
2

iex(3)> Elisper.eval([:+, [:+, 2, 2], [:+, 2, 3]])
9

Do Clauses

iex(5)> Elisper.eval([:do, [:print, "hello"], [:print, "world"]])
print function hello
print function world
:ok

If Statements

iex(7)> Elisper.eval([:if, [:=, 1, 1], [:+, 1, 1], [:+, 2, 2]])
2

Functions

iex(9)> Elisper.eval(
...(9)> [:do,
...(9)>       [:def, :multi,
...(9)>         [:fn, [:x, :y],
...(9)>           [:*, :x, :y]
...(9)>         ]
...(9)>       ],
...(9)>       [:multi, 3, 4]
...(9)>      ]
...(9)> )
12

About

Implementation of a subset of lisp in Elixir

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages