A.conj()

Read(891) Label: sequence, concatenate, new sequence,

Description:

Get concatenation of all sequence-type members.

Syntax:

A.conj(x)

Note:

The function concatenates all the sequence-type members in sequence A; compute expression x by loop and then concatenate the results when parameter x is present.

A.conj(x,…) is equivalen to A.(x,…).conj().

Option:

@r

Recursively concatenate members until there aren’t any sequence members.

@v

Return a pure sequence when members of A are pure sequences/pure table sequences.

Parameter:

A

A sequence whose members are sequences.

x

An expression; can be omitted.

Return value:

Sequence

Example:

When members of A are sequences:

 

A

 

1

=[[1,2,3],[4,5,6]].conj()

[1,2,3,4,5,6].

2

=[[1,[2,3]],[2,5,6]].conj()

[1,[2,3],2,5,6].

3

=[[1,2,3],[3],[7]].conj()

[1,2,3,3,7].

4

=[[1,[2,3]],[2,5,6]].conj@r()

Use @r option to recursively concatenate members until there isn’t any sequence member and return [1,2,3,2,5,6].

5

=[[1,2,3],[4,5,6]]

 

6

=A5.conj(~**2)

Return [2,4,6,8,10,12].

7

=A5.(~**2).conj()

Same result as A5.

 

When members of A are table sequences or record sequences

 

A

 

1

=demo.query("select  top 4 EID,NAME,GENDER from EMPLOYEE where GENDER = 'M' ")

2

=demo.query("select top 4 EID,NAME,GENDER  from EMPLOYEE where GENDER = 'F' ")

3

=[A1,A2].conj()

Compute concatenation of members of [A1,A2] and return result below:

4

=[A1,A2].conj(~.(NAME))

Compute concatenation of NAME fields of members of [A1,A2] and return

["Matthew","Ryan","Jacob","Daniel","Rebecca","Ashley","Rachel","Emily"]

5

=[A1,A2].(~.(NAME)).conj()

Same result as A4.

 

Return a pure sequence:

 

A

 

1

=[1,2,3].i()

Return a pure sequence.

2

=[4,5].i()

Return a pure sequence.

3

=[A1,A2].conj@v()

Use @v option to return a pure sequence.

4

=ifpure(A3)

Judge whether A3 is a pure sequence and return true.