aboutsummaryrefslogtreecommitdiffstats
path: root/lib/string.moon
blob: 8b48977f42d05719d4d8b4aa2475772796a9a2e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Op, Value, Input from require 'core.base'

str = Value.meta
  meta:
    name: 'str'
    summary: "Concatenate/stringify values."
    examples: { '(.. v1 [v2…])', '(str v1 [v2…])' }
  value: class extends Op
    new: => super 'str'

    setup: (inputs) => super [Input.value v for v in *inputs]
    tick: => @out\set table.concat [tostring v! for v in *@inputs]

{
  :str, '..': str
}