On Tue, Jul 24, 2012 at 2:53 PM, Nick Fagerlund <
[email protected]> wrote:
>
> Yo, docs team needs to know the answer to this one too.
>
> Puppet's "normal" data types (excluding regexes, which can't be used most
> places) are:
>
> **
>
> - Booleans
> - The special value "undef"
> - Strings
> - Resource references
> - Numbers
> - Arrays
> - Hashes
>
> **Are all of these valid to pass to functions?
>
And indeed, a few of the built-in functions _do_ seem to accept arrays. So
I'd expect that I can pass one to a custom function.
My first thoughts were that I've made some other unrelated error in syntax
or design or Ruby programming, as Ruby is a new language to me.
My second thought was that perhaps I need to send some other symbol to
newfunction() to indicate it _can_ accept arrays. I don't see that
mentioned anywhere in the source code for the built-ins, but while I'm
experienced with other languages, my inexperience in Puppet and Ruby might
be leading me astray.
My third thought was that somehow the functions that are built-in are
marked as able to accept arrays by some other portion of the Puppet code
that I don't know well enough to find.
The Puppet custom functions page doesn't mention much about it. I've been
doing web searches but am hindered somewhat by my inexperience, in that I
don't know what keywords to use, and the keywords I do use are generic
enough that they have a hard time drilling down to Puppet results ("object"
"reference" "array" "string" "function" "puppet" "ruby").
I'd vote for being able to pass standard Puppet data types into functions
if there were a decision to be made, even if they are not default and are
somehow restricted. I'd live with the input into a custom function being
unfolded if it's an array, however I see from past bug/trouble reports that
others have specifically requested that the ability to pass arrays be
restored, after accidental removal of that feature by adding unfolds at
various points in the code.
And, to keep this on a positive note, the Puppet devs have created a nice
piece of software, that seems quite well documented in most ways, I just
have a knack for stumbling into trouble.
--
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-dev/-/YvWUzmAOnUEJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.