diff options
author | nea <nea@nea.moe> | 2023-08-09 16:18:48 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-08-09 16:18:48 +0200 |
commit | b530d6360308ac1f68cf2508fa5bd4a085a8bec0 (patch) | |
tree | 4b966250615700983bb9172f10d7ecafbefece56 /test | |
download | nealisp-b530d6360308ac1f68cf2508fa5bd4a085a8bec0.tar.gz nealisp-b530d6360308ac1f68cf2508fa5bd4a085a8bec0.tar.bz2 nealisp-b530d6360308ac1f68cf2508fa5bd4a085a8bec0.zip |
Initial commit
Diffstat (limited to 'test')
-rw-r--r-- | test/res/test.lisp | 11 | ||||
-rw-r--r-- | test/src/TestLisp.kt | 14 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/res/test.lisp b/test/res/test.lisp new file mode 100644 index 0000000..f3d21d9 --- /dev/null +++ b/test/res/test.lisp @@ -0,0 +1,11 @@ +(debuglog "Hello, World, here is an atom:" :iamanatom) +(defun myfun (var) (debuglog var)) +(myfun :myfunworks) +((lambda (a) (debuglog a)) :atom) +(debuglog a) +(def helloworld (pure "hello world")) +(debuglog helloworld (helloworld)) +(defun + () (seq + (debuglog "also multiplication") + (debuglog "addition"))) +(debuglog +) diff --git a/test/src/TestLisp.kt b/test/src/TestLisp.kt new file mode 100644 index 0000000..f986f1c --- /dev/null +++ b/test/src/TestLisp.kt @@ -0,0 +1,14 @@ +import moe.nea.lisp.CoreBindings +import moe.nea.lisp.LispExecutionContext +import moe.nea.lisp.LispParser +import java.io.File + +object T + +fun main() { + val otherP = LispParser.parse(File(T::class.java.getResource("/test.lisp")!!.file)) + val executionContext = LispExecutionContext() + val bindings = executionContext.genBindings() + CoreBindings.offerAllTo(bindings) + executionContext.executeProgram(bindings, otherP) +} |