Return a list of elements between 'from' and 'to'.

Property definitions

core $ List :: slice
	# Return a list of elements between 'from' and 'to'.
	fun slice(from: Int, to: Int): List[E] do
		assert from >= 0 and from < length
		assert to >= 0 and to < length and from <= to
		var list = new List[E]
		while from <= to do
			list.add(self[from])
			from += 1
		end
		return list
	end
lib/core/collection/list.nit:72,2--82,4

pthreads $ ConcurrentList :: slice
	redef fun slice(from, to)
	do
		mutex.lock
		var r = real_collection.slice(from, to)
		mutex.unlock
		return r
	end
lib/pthreads/concurrent_collections.nit:469,2--475,4