core :: Sequence :: first=
Is equivalent with self[0] = item.
self[0] = item
var a = [1,2,3] a.first = 10 assert a == [10,2,3]
# Set the first item. # Is equivalent with `self[0] = item`. # # var a = [1,2,3] # a.first = 10 # assert a == [10,2,3] fun first=(item: E) do self[0] = item end
# O(1) redef fun first=(e) do _head.as(not null).item = e
redef fun first=(e) do mutex.lock real_collection.first = e mutex.unlock end