Create a new List with item added at the front. This is a constant time operation.
List
item
Immutable::List[:b, :c].add(:a) # => Immutable::List[:a, :b, :c]
Parameters:
The item to add
Returns:
189 190 191
# File 'lib/immutable/list.rb', line 189 def add(item) Cons.new(item, self) end