diff options
Diffstat (limited to 'src/Builtins.kt')
-rw-r--r-- | src/Builtins.kt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Builtins.kt b/src/Builtins.kt index f9bf329..21da218 100644 --- a/src/Builtins.kt +++ b/src/Builtins.kt @@ -1,6 +1,13 @@ package moe.nea.lisp object Builtins { - val builtinSource = Builtins::class.java.getResourceAsStream("/builtins.lisp")!!.bufferedReader().readText() - val builtinProgram = LispParser.parse("builtins.lisp", builtinSource) + + private fun builtin(name: String) = + LispParser.parse( + "$name.lisp", + Builtins::class.java.getResourceAsStream("/$name.lisp")!!.bufferedReader().readText() + ) + + val builtinProgram = builtin("builtins") + val testProgram = builtin("stdtest") }
\ No newline at end of file |