Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-1806

Varargs support for the new function API

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • PUP 3.7.5
    • Compiler, Docs
    • None

    Description

      There needs to be some way of specify varargs in the new function API, but in a way that still lets us do some type checking of the arguments.

      UPDATE


      The old arg_count and last_captures_rest methods should be removed and replaced by specific methods:

      • param or required_param for parameters that must be given
      • optional_param for parameters that may be missing
      • repeated_param for a parameter that may occur 0-many times of the given type

      An optional_param may not be followed by a required_param, there may only be one repeated_param and it can only appear last.
      Consequently, there should be a block_param method that is an alias for required_block_param

      For Documentation: The language specification contains the description of the 4x function api in the file 'func-api.md'

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              andy Andrew Parker
              Eric Thompson Eric Thompson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support