With the square bracket notation, the comma serves as delimiter:ĭeclare option output:method 'json' value Functions In BaseX, arrays (as well as sequences) are based on an efficient Finger Tree implementation.Īrrays can be constructed in two ways. In the type hierarchy, array has a distinct type, which is derived from function. The values of an array are called its members. The first position in an array is associated with the integer 1. The Map Module describes the available set of map functions.Īn array is a function that associates a set of positions, represented as positive integer keys, with values. Maps may be compared using the fn:deep-equal function. It is meaningful to compare the contents of two maps, but there is no way of asking whether they are "the same map": two maps with the same content are indistinguishable. For example, the map:remove function creates a new map by removing an entry from an existing map, but the existing map is not changed by the operation. Like all other values, maps are immutable. A map is an anonymous function, so fn:function-name returns the empty sequence fn:function-arity always returns 1. This returns some permutation of (42, 'baz', 456).īecause a map is a function item, functions that apply to functions also apply to maps. Let $ map := map return fn:for-each ( map:keys ( $ map ), $ map ) It is not necessary that all the keys should be mutually comparable (for example, they can include a mixture of integers and strings). Within a map, no two entries have the same key, when compared using the eq operator. A key is an arbitrary atomic value, and the associated value is an arbitrary sequence. Each key/value pair in a map is called an entry. A map is a function that associates a set of keys with values, resulting in a collection of key/value pairs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |