19.11.2014 Views

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

BinaryEndianLinearEndianSequence1,bigEndianBytes,bigEndianBits, m,bigEndianBits<br />

throws { IndexOutOfBoundsException }<br />

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

BinaryEndianLinearEndianSequence1,bigEndianBytes,bigEndianBits, m,bigEndianBits<br />

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

Subscripting with a range of static size m returns the indicated subsequence of bits of this binary endian word. <strong>The</strong><br />

numbering of the bits is dictated by bigEndianBits . <strong>The</strong> result is a binary endian linear endian sequence of bits<br />

whose sequence endianness is the same as the bit endianness of this binary endian word. Indexing is zero-origin;<br />

an IndexOutOfBoundsException is thrown unless r ⊆ 0 #2 b . If the subscript is a static range, then its validity is<br />

checked statically, and no exception will occur at run time. Element k of the result sequence is the same as the bit<br />

that would be selected from this binary endian word by subscripting it with r.lowerBound + k × r.stride , for all<br />

0 ≤ k < m .<br />

40.6.6 opr [j: IndexInt] := (v: Bit):<br />

BinaryEndianWordb,bigEndianBytes,bigEndianBits<br />

throws { IndexOutOfBoundsException }<br />

40.6.7 opr nat k[j: IntegerStatick] := (v:Bit):<br />

BinaryEndianWordb,bigEndianBytes,bigEndianBits<br />

where { k < 2 b }<br />

After subscripted value object assignment, the bit that would be selected from this binary endian word by subscripting<br />

it with j is the same as the given bit v , and all other bits are the same as before. Indexing is zero-origin; an<br />

IndexOutOfBoundsException is thrown unless 0 ≤ j < 2 b . If the subscript is a static expression, then its validity<br />

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

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

BinaryEndianWordb,bigEndianBytes,bigEndianBits<br />

throws { IndexOutOfBoundsException }<br />

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

BinaryEndianWordb,bigEndianBytes,bigEndianBits<br />

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

After subscripted value object assignment, bits that would be selected from this binary endian word by subscripting<br />

it with r are the same as corresponding elements of v , and all other bits are the same as before; specifically, the bit<br />

that would be selected from this binary endian word by subscripting it with r.lowerBound + k × r.stride is the same<br />

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

r ⊆ 0 #2 b . If the subscript is a static range, then its validity is checked statically, and no exception will occur at run<br />

time.<br />

285

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

Saved successfully!

Ooh no, something went wrong!