summaryrefslogtreecommitdiff
path: root/test/lisp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp.lua')
-rw-r--r--test/lisp.lua22
1 files changed, 0 insertions, 22 deletions
diff --git a/test/lisp.lua b/test/lisp.lua
deleted file mode 100644
index e6bcd084..00000000
--- a/test/lisp.lua
+++ /dev/null
@@ -1,22 +0,0 @@
--- a simple LISP evaluator
-
-function eval(x)
- if type(x)=="table" then
- return eval(x[1])(eval(x[2]),eval(x[3]))
- else
- return x
- end
-end
-
-function add(x,y) return x+y end
-function sub(x,y) return x-y end
-function mul(x,y) return x*y end
-function div(x,y) return x/y end
-function pow(x,y) return x^y end
-
--- an example
-
-function E(x) print(eval(x)) end
-
-E{add,1,{mul,2,3}}
-E{sin,60}