Return the index-th element of the sequence.

The first element is 0 and the last is length-1 If index is invalid, the program aborts

var a = [10,20,30]
assert a[0]   == 10
assert a[1]   == 20
assert a[2]   == 30

REQUIRE index >= 0 and index < length

Property definitions

core $ SequenceRead :: []
	# Return the index-th element of the sequence.
	# The first element is 0 and the last is `length-1`
	# If index is invalid, the program aborts
	#
	#     var a = [10,20,30]
	#     assert a[0]   == 10
	#     assert a[1]   == 20
	#     assert a[2]   == 30
	#
	# REQUIRE `index >= 0 and index < length`
	fun [](index: Int): E is abstract
lib/core/collection/abstract_collection.nit:852,2--862,34

nitcc_runtime $ NProdChildren :: []
	redef fun [](i) do return prod.child(i)
lib/nitcc_runtime/nitcc_runtime.nit:575,2--40

core $ RopeChars :: []
	redef fun [](i) do
		return target[i]
	end
lib/core/text/ropes.nit:648,2--650,4

core $ RopeBytes :: []
	redef fun [](i) do
		assert i >= 0 and i < target._byte_length
		var flps = _cache_start
		if i >= flps and i <= _cache_end then
			return _cache.bytes[i - flps]
		end
		var lf = get_leaf_at(i)
		return lf.bytes[i - _cache_start]
	end
lib/core/text/ropes.nit:670,2--678,4

core $ FlatStringCharView :: []
	redef fun [](index) do return target[index]
lib/core/text/flat.nit:778,2--44

core $ FlatStringByteView :: []
	redef fun [](index)
	do
		# Check that the index (+ _first_byte) is not larger than last_byte
		# In other terms, if the index is valid
		var target = _target
		assert index >= 0 and index < target._byte_length
		var ind = index + target._first_byte
		return target._items[ind]
	end
lib/core/text/flat.nit:843,2--851,4

pthreads $ ConcurrentSequenceRead :: []
	redef fun [](index)
	do
		mutex.lock
		var r = real_collection[index]
		mutex.unlock
		return r
	end
lib/pthreads/concurrent_collections.nit:196,2--202,4

core $ U16StringCharView :: []
	redef fun [](index) do return target[index]
lib/core/text/u16_string.nit:226,2--44

core $ FlatBufferByteView :: []
	redef fun [](index) do return target._items[index]
lib/core/text/flat.nit:1191,2--51

java $ JavaIntArray :: []
	redef fun [](i) in "Java" `{ return self[(int)i]; `}
lib/java/collections.nit:56,2--53

java $ JavaShortArray :: []
	redef fun [](i) in "Java" `{ return (short)self[(int)i]; `}
lib/java/collections.nit:70,2--60

java $ JavaLongArray :: []
	redef fun [](i) in "Java" `{ return self[(int)i]; `}
lib/java/collections.nit:84,2--53

java $ JavaFloatArray :: []
	redef fun [](i) in "Java" `{ return (double)self[(int)i]; `}
lib/java/collections.nit:101,2--61

java $ JavaDoubleArray :: []
	redef fun [](i) in "Java" `{ return self[(int)i]; `}
lib/java/collections.nit:115,2--53

java $ JavaArray :: []
	redef fun [](i) in "Java" `{ return self[(int)i]; `}
lib/java/collections.nit:129,2--53

java $ JavaBoolArray :: []
	redef fun [](i) in "Java" `{ return self[(int)i]; `}
lib/java/collections.nit:143,2--53

java $ JavaByteArray :: []
	redef fun [](i) in "Java" `{ return (byte)self[(int)i]; `}
lib/java/collections.nit:157,2--59

java $ JavaCharArray :: []
	redef fun [](i) in "Java" `{ return (char)self[(int)i]; `}
lib/java/collections.nit:171,2--59

c $ CArray :: []
	redef fun [](index)
	do
		assert not destroyed
		assert index >= 0 and index < length
		return native_array[index]
	end
lib/c/c.nit:35,2--40,4

core $ List :: []
	redef fun [](index) do return get_node(index).as(not null).item
lib/core/collection/list.nit:24,2--64

core $ CircularArray :: []
	redef fun [](index) do return native[offset(index)]
lib/core/collection/circular_array.nit:89,2--52

more_collections $ UnrolledList :: []
	redef fun [](index)
	do
		var node = node_at(index)
		index = index_within_node + node.head_index
		return node.items[index]
	end
lib/more_collections/more_collections.nit:413,2--418,4

dom $ XMLEntities :: []
	redef fun [](i) do return entities[i]
lib/dom/xml_entities.nit:68,2--38

core $ FlatBufferCharView :: []
	redef fun [](index) do return target[index]
lib/core/text/flat.nit:1242,2--44

core $ Array :: []
	redef fun [](index)
	do
		assert index: index >= 0 and index < _length
		return _items.as(not null)[index]
	end
lib/core/collection/array.nit:321,2--325,4

pthreads :: redef_collections $ Array :: []
	redef fun [](index)
	do
		mutex.lock
		var r = super
		mutex.unlock
		return r
	end
lib/pthreads/redef_collections.nit:54,2--60,4

core $ Bytes :: []
	#     var b = new Bytes.empty
	#     b.add 101
	#     assert b[0] == 101
	redef fun [](i) do
		assert i >= 0
		assert i < length
		return items[i]
	end
lib/core/bytes.nit:273,2--280,4