A .m( a:b,c,d:e )

Description:

Get members of a sequence at specified positions to form a new sequence.

Syntax:

A.m(a:b,c,d:e)

 

Note:

A is a sequence whose length is n, from which you get members at specified positions to form a new sequence, with the condition -n<=a<=n & a!=0. If 1£a£n, it is the ath member of sequence A when counted from left to right; if -n£ a £-1, it is the ath member of sequence A when counted from right to left. The rules also apply to b, c, d, and e. So the function is ofent used to get members reversely from a sequence. The members a and d represent must be respectively on the left side of the members b and e designate. When the parameter on the left side of the colon is omitted, the default value is 1; when the parameter on the right side of the colon is omitted, the default value is -1.

Parameters:

A

A sequence

a

An integer; 1 by default

b

An integer; -1 by default

c

An integer

d

An integer; 1 by default

e

An integer; -1 by default

Return value:

A sequence

Example:

 

A

 

1

=to(1,100).m(1:3,9,97:)

[1,2,3,9,97,98,99,100]

2

=to(1,100).m(:5,-1,66:-32)

[1,2,3,4,5,100,66,67,68,69]