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.3.2 opr nat m[r:RangeOfStaticSizeIndexInt, m]:LinearSequenceT, m<br />

throws { IndexOutOfBoundsException }<br />

Subscripting by a range returns the indicated subsequence of this heap sequence. <strong>The</strong> range must be a range of static<br />

size, and the result is returned as a linear sequence (not a heap sequence), so no heap allocation is performed. Indexing<br />

is zero-origin; an IndexOutOfBoundsException is thrown unless r ⊆ (0 :n − 1) , where n is the length of the heap<br />

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

sequence, for all 0 ≤ k < m .<br />

40.3.3 opr [j : IndexInt] := (v:T): () throws { IndexOutOfBoundsException }<br />

After subscripted assignment, element j of this heap sequence is the same as the given value v , and all other elements<br />

are the same as before. Indexing is zero-origin; an IndexOutOfBoundsException is thrown unless 0 ≤ j < n ,<br />

where n is the length of the heap sequence.<br />

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

throws { IndexOutOfBoundsException }<br />

After subscripted assignment using a range as a subscript, elements of the subscripted variable selected by r are<br />

the same as corresponding elements of v , and all other elements are the same as before; specifically, element<br />

r.lowerBound + k × r.stride of the updated variable is the same as element k of v , for all 0 ≤ k < m . <strong>The</strong> range<br />

must be a range of static size, and the values to be assigned must be passed as linear sequence of the same size. Indexing<br />

is zero-origin; an IndexOutOfBoundsException is thrown unless r ⊆ (0 :n − 1) , where n is the length of the<br />

heap sequence.<br />

40.3.5 reverse(selfStart: IndexInt,length: IndexInt):() throws { IndexOutOfBoundsException }<br />

Elements selfStart through selfStart + length − 1 , inclusive, are reversed in order, that is, rearranged so that the<br />

value originally stored at element selfStart + j becomes element selfStart + length − 1 − j , for all 0 ≤ j < length .<br />

Other elements of this heap sequence are unaffected.<br />

40.3.6 opr |self| : IndexInt<br />

<strong>The</strong> length of this heap sequence is returned. Note that the size of a heap sequence is specified at run time when the<br />

heap sequence is created; once a heap sequence has been created, its length does not change.<br />

277

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

Saved successfully!

Ooh no, something went wrong!