Add base support for invoking custom functions (arguments' evaluating is still not supported)
This commit is contained in:
@@ -8,7 +8,7 @@ import io.smnp.type.model.Value
|
||||
|
||||
class PrintlnFunction : Function("println") {
|
||||
override fun define(new: FunctionDefinitionTool) {
|
||||
new function vararg(allTypes()) define { _module, (vararg) ->
|
||||
new function vararg(allTypes()) body { _, (vararg) ->
|
||||
// TODO: Implement equivalent of "toString()" method
|
||||
println((vararg.value!! as List<Value>).joinToString("") { it.value!!.toString() })
|
||||
Value.void()
|
||||
|
||||
@@ -7,7 +7,7 @@ import io.smnp.type.model.Value
|
||||
|
||||
class DebugFunction : Function("debug") {
|
||||
override fun define(new: FunctionDefinitionTool) {
|
||||
new function simple() define { env, _ ->
|
||||
new function simple() body { env, _ ->
|
||||
env.printCallStack()
|
||||
Value.void()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user