Get the last item.

Is equivalent with self[length-1].

var a = [1,2,3]
assert a.last   == 3

REQUIRE not is_empty

Property definitions

core $ SequenceRead :: last
	# Get the last item.
	# Is equivalent with `self[length-1]`.
	#
	#     var a = [1,2,3]
	#     assert a.last   == 3
	#
	# REQUIRE `not is_empty`
	fun last: E
	do
		assert not_empty: not is_empty
		return self[length-1]
	end
lib/core/collection/abstract_collection.nit:932,2--943,4

pthreads $ ConcurrentSequenceRead :: last
	redef fun last
	do
		mutex.lock
		var r = real_collection.last
		mutex.unlock
		return r
	end
lib/pthreads/concurrent_collections.nit:236,2--242,4

core $ List :: last
	# O(1)
	redef fun last do return _tail.as(not null).item
lib/core/collection/list.nit:34,2--35,49