aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debug.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-01 17:44:56 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-01 17:46:04 +0000
commita1312100fad100190e20b1b3443b5cd962dc8999 (patch)
tree8fc6194fc4b326ee39a9ca6d798cd208664f5fc3 /lib/debug.moon
parentadd type-pattern matching language (diff)
downloadalive-a1312100fad100190e20b1b3443b5cd962dc8999.tar.gz
alive-a1312100fad100190e20b1b3443b5cd962dc8999.zip
new op interface part one
Diffstat (limited to 'lib/debug.moon')
-rw-r--r--lib/debug.moon16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/debug.moon b/lib/debug.moon
index 08a7f78..1457cee 100644
--- a/lib/debug.moon
+++ b/lib/debug.moon
@@ -1,15 +1,19 @@
import Op from require 'core'
+import ValueInput, EventInput from require 'core.base'
+import match from require 'core.pattern'
class out extends Op
- @doc: "(out name-str value) - log value to the console"
+ @doc: "(out [name-str?] value) - log value to the console"
- setup: (params) =>
- super params
- assert @inputs[2], "need a value"
- @assert_types 'str', @inputs[2].type
+ setup: (inputs) =>
+ { name, value } = match 'str? any', inputs
+ super
+ name: name and ValueInput name
+ value: ValueInput value
tick: =>
- L\print @unwrap_inputs!
+ { :name, :value } = @unwrap_all!
+ L\print if name then name, value else value
{
:out