Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Array-concatenation/Onyx/array-concatenation.onyx
Normal file
13
Task/Array-concatenation/Onyx/array-concatenation.onyx
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# With two arrays on the stack, cat pops
|
||||
# them, concatenates them, and pushes the result back
|
||||
# on the stack. This works with arrays of integers,
|
||||
# strings, or whatever. For example,
|
||||
|
||||
[1 2 3] [4 5 6] cat # result: [1 2 3 4 5 6]
|
||||
[`abc' `def'] [`ghi' `jkl'] cat # result: [`abc' `def' `ghi' `jkl']
|
||||
|
||||
# To concatenate more than two arrays, push the number of arrays
|
||||
# to concatenate onto the stack and use ncat. For example,
|
||||
|
||||
[1 true `a'] [2 false `b'] [`3rd array'] 3 ncat
|
||||
# leaves [1 true `a' 2 false `b' `3rd array'] on the stack
|
||||
Loading…
Add table
Add a link
Reference in a new issue