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

make it possible to invoke 'Type.new(e)' as e.Type()

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Ready for Engineering
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: PUP 5.y
    • Component/s: Functions, Language, Type System
    • Labels:
      None
    • Template:
    • Epic Link:
    • Sub-team:
    • Team:
      Froyo
    • Story Points:
      1
    • Release Notes:
      New Feature
    • Release Notes Summary:
      It is now possible to make a call to {{new}} for a data type as a chained operation. Where earlier this required writing code on the form {{T(expression}}, this can now be written in an easier to read left-to-right form {{expression.T()}}
    • QA Risk Assessment:
      Needs Assessment

      Description

      At the moment it is not possible to make a new call at the end of a transformation. You need to do something like:

      Hash($data.reduce |$memo, $entry| { ... })
      

      because it is not possible to do this:

      $data.reduce |$memo, $entry| { ... }).new(Hash)
      

      What you want is the more natural left-to-right reading:

      $data.reduce |$memo, $entry| { ... }.Hash
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            henrik.lindberg Henrik Lindberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support