Skip to content

AppendTo

Name - Description Default Type
<input> The value to append to the collection. Any
<output> The input to this shard is passed through as its output. Any
Collection The collection to add the input to. None &[Any]&String&Bytes

Appends the input to the context variable passed to :Collection.

Details

AppendTo appends (i.e., adds to the end) its input to the variable it receives in its :Collection parameter.

This shard works on string and sequence variables.

The input to this shard is also passed through as its output.

See also

Examples

1
2
3
4
5
6
7
8
9
;; append element to sequence
[1 2 3] >= .seq
4 (AppendTo .seq)    ;; appends element to sequence
.seq (Log)           ;; updated sequence => [1, 2, 3, 4]

;; append character to string
"Hell" >= .str
"o" (AppendTo .str)  ;; appends character to string
.str (Log)           ;; updated string => Hello
[info] [shards/General/AppendTo/AppendTo.edn] [1 2 3 4]
[info] [shards/General/AppendTo/AppendTo.edn] Hello