Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7171

List.getIndices()

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.4.0-rc-1
    • groovy-jdk
    • None

    Description

      Can I send a pull request of List.getIndices() to GitHub?

      The method name is from Haskell, Scala and Kotlin.
      They all use "indices" not "indexes".

      The implementation is this.

      public static IntRange getIndices(List self) {
          return new IntRange(false, 0, self.size());
      }
      

      Usage:

      for (i in [1, 2].indices) {}
      

      Attachments

        Activity

          People

            paulk Paul King
            yukoba Yu Kobayashi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: