Changes

Jump to navigation Jump to search
97 bytes added ,  21:05, 9 August 2014
</pre>
With the {{Code|array}} keyword and curly brackets, a comma the inner expression is evaluated in as usual, and the usual wayresulting values will be the members of the array:
<pre class="brush:xquery">
</pre>
The function corresponding to the array has the signature {{Code|function($index as xs:integer) as item()*}}. The expression {{Code|$array($index)}} returns an addressed member of the associated memberarray. The fact that an following query returns {{Code|48 49 50 51 52}} as result: <pre class="brush:xquery">let $array := array is a function item allows it { 48 to be passed as an argument 52 }for $i in 1 to higher-order functions that expect a function item as one of their arguments.array:size($array)return $array($i)</pre>
Like all other values, arrays are immutable. For example, the <code>[[Array Module#array:reverse|array:reverse]]</code> function creates a new array containing a re-ordering of the members of an existing array, but the existing array is not changed by the operation.
Like all other values, arrays are immutable. For example, the <code>[[Array Module#array:reverse|array:reverse]]</code> function creates a new array containing a re-ordering of the members of an existing array, but the existing array is not changed by the operation. Like sequences, arrays have no identity. It is meaningful to compare the contents of two arrays, but there is no way of asking whether they are "the same array": two arrays with the same content are indistinguishable.
Arrays may be compared using the {{Code|fn:deep-equal}} function. The [[Array Module]] describes the available set of array functions.
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu