On Mon, Aug 4, 2014 at 3:18 PM, Henrik Lindberg <
henrik.lindb...@cloudsmith.com> wrote:

>
> So, to summarize: The use of * => as an operator is not liked but the
> concept of being able to set attributes from a hash is. Unfortunately, it
> is not possible to directly allow an expression at the position in
> question, there must be a syntactical marker.
>
> As pointed out earlier, the * => was thought to read as "any_attribute =>
> from_these_values", but I totally grok if people have an allergic reaction.
>
> We can do this though:
>
> file { default: ($hash) }
>
> This works because it is impossible to have an attribute name in
> parentheses.
>
> In use:
>
> file (
>   default   : ($my_file_defaults + { mode => '0666' });
>   '/tmp/foo': ;
>   '/tmp/bar': ;
> }
>
> Is that better? No new operator, but you have to use parentheses around
> the expression.
>
> We can naturally also revert the functionality, but it seems it is liked
> conceptually.
>
>
> - henrik
>


I think the parenthesis are far preferable over *=>. That isn't to say I
like them - I don't particularly. But the functionality is desirable, and
if it's a matter of a technical limitation then parenthesis are a Good
Enough (TM) compromise from the more ideal direct use of a hash.

~Reid

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/CAHNFGkO329huKu%2BZH8KsQpQs_k6Txni%2Bj-3Tuiu7QtdA6HMQ7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to