Array concatenation: Difference between revisions
Content added Content deleted
(Jakt) |
No edit summary |
||
Line 1,669: | Line 1,669: | ||
<syntaxhighlight lang="lisp">(vconcat '[1 2 3] '[4 5] '[6 7 8 9]) |
<syntaxhighlight lang="lisp">(vconcat '[1 2 3] '[4 5] '[6 7 8 9]) |
||
=> [1 2 3 4 5 6 7 8 9]</syntaxhighlight> |
=> [1 2 3 4 5 6 7 8 9]</syntaxhighlight> |
||
=={{header|EMal}}== |
|||
<syntaxhighlight lang="emal"> |
|||
type ArrayConcatenation |
|||
^|EMal has the concept of list expansion, |
|||
|you can expand a list to function arguments |
|||
|by prefixing the list with the unary plus. |
|||
|Then we have the "of" method that allows list inizialization. |
|||
|^ |
|||
List a = int[1,2,3] |
|||
List b = int[4,5,6] |
|||
List c = int[].of(+a, +b) |
|||
writeLine(c) |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
[1,2,3,4,5,6] |
|||
</pre> |
|||
=={{header|Erlang}}== |
=={{header|Erlang}}== |