- fun length: Int is abstract
-
- # Is `item' in the collection ?
- # Comparaisons are done with ==
- fun has(item: E): Bool is abstract
-
- # Is the collection contain only `item' ?
- # Comparaisons are done with ==
- # Return true if the collection is empty.
- fun has_only(item: E): Bool is abstract
-
- # How many occurences of `item' are in the collection ?
- # Comparaisons are done with ==
- fun count(item: E): Int is abstract
-
- # Return one the item of the collection
- fun first: E is abstract
-end
-
-# Naive implementation of collections method
-# You only have to define iterator!
-interface NaiveCollection[E]
- super Collection[E]
- redef fun is_empty do return length == 0
-
- redef fun length
+ #
+ # assert [10,20,30].length == 3
+ # assert [20..30[.length == 10
+ fun length: Int