aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debug.moon
diff options
context:
space:
mode:
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