I see there are the following DGMs for getting first element of a "collection":

  static <T> T first(T[] self)

  static <T> T first(List<T> self)

  static <T> T first(Iterable<T> self)


Is there a simple sequence for getting the first element or a default value if 
the "collection" is empty?  If not, may I propose the addition of the following 
DGMs:

  static <T> T first(T[] self, T defaultValue)

  static <T> T first(List<T> self, T defaultValue)

  static <T> T first(Iterable<T> self, T defaultValue)

  static <T> T first(T[] self, Closure<T> defaultSupplier)
  static <T> T first(List<T> self, Closure<T> defaultSupplier)

  static <T> T first(Iterable<T> self, Closure<T> defaultSupplier)



Eric M.

Reply via email to