We can see that members of sequence A3 are a number of sequences whose members are records.

**Accessing**

**4.Access members according to serial numbers**

A1=[a,b,c,d,e,f,g] /Sequence A1

A1(2) /Fetch the second member whose value is string âbâ, which equals to A1.m(2)

A1([2,3,4]) /Fetch members from the second to the fourth, whose value is expressed by the sequence [b,c,d]. Note that [2,3,4] is also a sequence(integer sequence). Intervals can be used to rewritten the expression as A1(to(2,4)).

A1.m(-1) /Fetch the last member. Note that m function must be used when fetching members backwards, the expression cannot be abbreviated to A1(-1).

**5. Assignment and modification**

A1(2)=r /Modify the second member to r, now value of sequence A1 is [a,r,c,d,e,f,g]

A1([2,4])=["r","s"] /Modify the second and the fourth member. A1=[a,r,c,s,d,e,f,g]

A1.Modify(2,["r","s"]) /Modify in turn from the second member, expression A1= [a,r,s,d,e,f,g] equals to A1([2,3])=["r","s"]

**6. Add members**

A1.Insert(0,"r") Add members at the end of the sequence, A1=[a,b,c,d,e,f,g,r]

A1.Insert(2,["r","s","t"]) /Insert three members consecutively before the second member, A1=[ a,r,s,t,b,c,d,e,f,g,r]

**7. Delete members**

A1.Delete(2) /Delete the second member

A1.Delete([2,4]) /Delete the second and the fourth member

**Operators**

**8. Sets computation**

Sets computation include ^ intersection, & union, \complement, and |concatenate, etc. For example:

A1=["a","b",1,2,3,4] /Sequence A1

B1= ["d","b",10,12,3,4] /Sequence A2

A1^B1 /Intersection, return the sequence made up of members of both thetwo sequences, value is ["a","b",3,4]

A1\B1 /Complement, a new sequence created by successively removing from A1 the members of B1, value is ["a",1,2]

A1&B1 /Union, value is["a","b",1,2,3,4,"d",10,12]

A1|B1 /Concatenate, value is ["a","b",1,2,3,4,"d","b",10,12,3,4]

**Note: **Both union and concatenate are created by combining members of two sequences in order. Common members only appear once in union while, in concatenate, all of them will appear.

**9. Alignment arithmetic operation**

Two sequences of the same length can make alignment operation according to members and return the sequence. The operation includes ++ (add), -- (subtract), ** (multiply), // (divide) and %% (complementation). For example:

A1=[1,2,3,4] /Sequence A1

B1= [10,12,3,4] /Sequence A2

A1++B1 /Counterpoint addition, value is [11,14,16,18]

**10. Boolean operation**

Two sequences can compare in alignment, the result is a Boolean type.

[1,2,3]==[1,2,3] /Comparative result is true

[1,B,3]<=[1,b,4] /Comparative result is true, because B is less than b

[1,2,3]<[1,3,4] /Result is true, because the second member of [1,2,3] is â2â , which is smaller than the second member â3â of [1,3,4]

**Note**: âinâ function is used to judge the inclusion relation between sequences.

**Functions**

**11. Aggregate function**

Functions for sequences include sum, avg, max, variance,etc. For example:

A1=[2,4,6] /Sequence

A1.sum() /Summation, result is 12

A1.sum(~*~) /Quadratic sum, which equals to 2*2+4*4+6*6, result is 56. ~ represents each member of a sequence.

**12. Loop function**

Loop function can make computation aiming at every member of a sequence, and express complex loop statement with simple functions, including loop computation, filter, locate, look up, rank, sort, etc.

A1=[2,4,-6] /Construct sequence A1

A1=(~+1) /Add 1 to every member, result is [3,5,-5]

A1.select(~>1) /Filter out members that are greater than 1, result is [2,4]

A1.pselect@a(~>1) /Locate serial numbers of members that are greater than 1, result is [1,2]

A1.pos([-6,2]) /Look up serial numbers of members -6 and 2 in A1, result is [3,1]

A1.rank() /Rank of members of the sequence, result is [2,1,3]

A1.sort() /Sort in ascending order, result is [-6,2,4]; [2,4,-6].sort(~:-1) is the expression when sorting in descending order