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

Varargs support for the new function API

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: PUP 3.7.5
    • Component/s: Compiler, Docs
    • Labels:
      None
    • Template:
    • Story Points:
      2
    • Sprint:
      Language 2015-03-04

      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

              • Assignee:
                Unassigned
                Reporter:
                andy Andrew Parker
                QA Contact:
                Eric Thompson
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support