Uploaded image for project: 'Documentation (moved to puppet.atlassian.net)'
  1. Documentation (moved to puppet.atlassian.net)
  2. DOCUMENT-1293

Iterable behavior of Integers not documented?

    XMLWordPrintable

Details

    • Improvement
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • DOC
    • Needs Assessment

    Description

      I discovered, entirely by accident, that an Integer is an Iterable which expands to the range from zero to one less than the Integer. I can find this in the code and it's clearly an intended behavior:

      https://github.com/puppetlabs/puppet/blob/7.13.1/lib/puppet/pops/types/iterable.rb#L44
      https://github.com/puppetlabs/puppet/blob/7.13.1/lib/puppet/pops/types/iterable.rb#L92

      I can't find this documented at all, though. Unless I'm missing something, the closest I can find is references to the Iterable type, though these pages don't enumerate what the type contains:
      https://puppet.com/docs/puppet/7/functions_iterative.html
      https://puppet.com/docs/puppet/7/lang_data_abstract.html#iterable-data-type

      Thanks,
      Corey

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bugfood Corey Hickey
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Zendesk Support