semi-colons or carriage-return are used as rows separators.
Multiple rows do not need the continuation dots ..

Types conversions

In some limits, brackets may be applied on a set of data having
different but compatible types. In this case, some data are converted
into the dominating type available in the set. The main conversion
rules are the following:

boolean < decimal number < complex

decimal number < polynomial < rational

booleans and polynomials are not compatible.

[%t 2. %z] is accepted:
[%t 2.] is first
converted into
[1. 2.], and then
[[1. 2.] %z] is accepted.

The result becomes complex-encoded as soon as
a complex-encoded component -- value, polynomial,
or rational -- is met in the list
(even with a null imaginary part)

Similarly, the result becomes sparse-encoded
as soon as a sparse-encoded component is met
and processed.

It is possible to concatenate polynomials or/and
rationals having different variable names. Then,
the first polynomial or rational met in the list
sets the variable name to the concatenation result:
[%z, 1+%s, 1-%i*%s]
// => [z, 1+z, 1-iz].

Any encoded integer can be concatenated
only with integers of the same inttype.
Thus, the expressions
[%t int8(2)],
[int8(2) uint8(7)],
[int8(2) int16(7)],
[int8(2) 1.] will all yield
an error.

Text components can be concatenated
(in the set meaning, with brackets) only with other
text components or with the empty matrix.
[].

Overloading

[,]: horizontal concatenation:
This operator is binary and automatically
iterated from left to right. Its overloading
code is "c".

[;]: vertical concatenation:
This operator is binary and automatically
iterated from top to bottom. Its overloading
code is "f".

Extensions

To stack vectors or matrices over some dimension > 2 to build a
N-dimensional array, please use cat.

[] on left-hand side of a "=" assignment

In this case, brackets are no longer concatenators.
They are used as left and right delimiters of a series of
variables used as recipients.

Recipients must be variables.
Litteral expressions are not accepted.

Variables shall be separated with comas.

In a distributive assignment, there must
be at most as many LHS recipients
as output sources, not more. If there are less
recipients on the left than sources on the right,
non-collected data sources are ignored. Examples :

[a,b]=(%pi,"Hi", %z)
is OK, but %z is ignored.

[a,b,c]=(%pi,"Hi")
yields an error because c
expects some foods.

The same variable may be used several times
in the list. Then, multiple assignments are done from
right to left (!)
and overwrite the previous ones.
Example :
[a,b,a] = (%pi, %z, "Allo")
is equivalent to a = %pi, b = %z.

Examples

// Horizontal concatenationsa=[%pi4-1]b1=grand(3,4,"uin",0,10)b2=grand(3,2,"uin",0,10)b=[b1b2]// they must have the same number of rows// Vertical concatenationsa=[-2;10;7]b1=grand(2,4,"uin",0,10)b2=grand(3,4,"uin",0,10)b=[b1;b2]// they must have the same number of columns// Mixed horizontal and vertical concatenationsa=[37;6,5]b=[1:3;7:3:13]c=[ab;ab]d=[3514]e=[dddddd]// Concatenation of various types of data:['this is';'a column';'of texts']s=poly(0,'s');[1/s,2/s][tf2ss(1/s),tf2ss(2/s)][%t%f%f%T%F]// Heterogeneous concatenations with automatical types conversions[%T%pi%f2][%pi,2+%i,%F]v=[%pi+0*%i,%F,%z,(1-%z)^2];typeof(v),isreal(v)v=[101/%z],typeof(v)// Incompatible heterogeneous concatenations => ERRORS[%F%z][%Fint8(5)][int8(%pi)uint8(%e)][int8(%pi)int16(%e)]// Concatenation of cells arrays:c1={%pi%t};c2={%z"abc"};c=[[{%i}c1];[c2,{1/%z^2}]]// comma mandatory, to not parse c2{1/%z^2}

Distributive assignments:

// Output from a function. Most often, output results are serially optional:M=rand(3,3);[u,s]=schur(M)// we expect and use both results u and su=schur(M)// we expect and store only the first result u// Direct RHS list[a,b,c]=(%pi,%t,"test")[a,b]=(%e,%f,"Hello")[a,b,a]=(%pi,%t,"test");// Explicit RHS listL=list(%z,%i,%t,%pi,"Text");[a,b,c]=L(:)// RHS structures(2,3).r=%pi;s(2,1).r=%i;s(2,2)=%e;s(2,:).rs.r([246])[a,b,c]=s.r([246])// Forbidden / Rejected LHS expressions (=> error)[m,n,m+n]=myfun(a,b)// Symbolic expressions like "m+n" are forbidden[p,4.5,q]=myfun(a,b)// Literal LHS values or expressions like "4.5" are forbidden[r,s+3]=myfun(a,b)// Expressions mixing literals and symbols like "s+3" can't be LHS recipients