19.11.2014 Views

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

40.1.4 opr [j: IndexInt]:T throws { IndexOutOfBoundsException }<br />

40.1.5 opr nat k[j: IntegerStatick]: T where { k < n }<br />

Subscripting returns element j of this linear sequence. Indexing is zero-origin; an IndexOutOfBoundsException is<br />

thrown unless 0 ≤ j < n , where n is the length of the linear sequence. If the subscript is a static expression, then its<br />

validity is checked statically, and no exception will occur at run time.<br />

40.1.6 opr nat m[r:RangeOfStaticSizeIndexInt, m]:LinearSequenceT, m<br />

throws { IndexOutOfBoundsException } where { m ≤ n }<br />

40.1.7 opr int a,nat m,int c[r: StaticRangea, m, c]:LinearSequenceT, m<br />

where { 0 ≤ a < n, 0 ≤ a + m · c < n }<br />

Subscripting with a range of static size m returns the indicated subsequence of this linear sequence. Indexing is zeroorigin;<br />

an IndexOutOfBoundsException is thrown unless r ⊆ 0 #n, where n is the length of the linear sequence.<br />

If the subscript is a static range, then its validity is checked statically, and no exception will occur at run time. Element<br />

k of the result sequence is the same as element r.lowerBound + k × r.stride of this linear sequence, for all<br />

0 ≤ k < m .<br />

40.1.8 opr [j: IndexInt] := (v: T):LinearSequenceT, n throws { IndexOutOfBoundsException }<br />

40.1.9 opr nat k[j: IntegerStatick] := (v:T): LinearSequenceT, n where { k < n }<br />

After subscripted value object assignment, element j of the subscripted variable is the same as the given value v ,<br />

and all other elements are the same as before. Indexing is zero-origin; an IndexOutOfBoundsException is thrown<br />

unless 0 ≤ j < n , where n is the length of the linear sequence. If the subscript is a static expression, then its validity<br />

is checked statically, and no exception will occur at run time.<br />

40.1.10 opr nat m[r:RangeOfStaticSizeIndexInt, m] := (v:LinearSequenceT, m):<br />

LinearSequenceT, n<br />

throws { IndexOutOfBoundsException } where { m ≤ n }<br />

40.1.11 opr int a,nat m,int c[r: StaticRangea, m, c] := (v:LinearSequenceT, m):<br />

LinearSequenceT, n<br />

where { 0 ≤ a < n, 0 ≤ a + m · c < n }<br />

After subscripted value object assignment, elements of the subscripted variable selected by r are the same as corresponding<br />

elements of v , and all other elements are the same as before; specifically, element r.lowerBound + k × r.stride<br />

of the updated variable is the same as element k of v , for all 0 ≤ k < m . Indexing is zero-origin; an IndexOutOfBoundsException<br />

is thrown unless r ⊆ 0 #n, where n is the length of the linear sequence. If the subscript is a static range, then its<br />

validity is checked statically, and no exception will occur at run time.<br />

274

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!