Skip to content

Addition of new length function #736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2017
Merged

Conversation

HelenCampbell
Copy link
Contributor

No description provided.

#A function to eventually replace the old size() function for stdlib - The original size function did not handle Puppets new type capabilities, so this function is a Puppet 4 compatible solution.
Puppet::Functions.create_function(:length) do
dispatch :length do
param 'Any', :value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the proper type declaration here, using Variant, will avoid the need for the raise in L12 below.

Using the proper type declarations here, using different dispatches for Strings, and others, will avoid the need for the if chain in L7.

@HelenCampbell HelenCampbell force-pushed the lengthfunct branch 5 times, most recently from eb1741f to 0724ebe Compare March 14, 2017 12:09
Copy link
Contributor

@DavidS DavidS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@DavidS
Copy link
Contributor

DavidS commented Mar 14, 2017

Title needs changing, and still waiting for travis&appveyor

@HelenCampbell HelenCampbell changed the title (WIP) Addition of new length function Addition of new length function Mar 14, 2017
@DavidS DavidS merged commit 84a1ddd into puppetlabs:master Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants