On 2014-03-07 22:57, John Bollinger wrote:
Here's another idea: how about removing resource defaults altogether? My take on them has always been that their dynamic scope was their most important feature. If that's going away then what's left is just a minor piece of syntactic sugar, and keeping them in that restricted form is certain to cause more pain than than just dropping them would..
There are several kinds of scoping in effect. It used to be dynamic, which if I understood this correctly meant that defaults applied from where something was defined as well as where it was included.
We now flipped that to follow how variables are resolved, if not defined in the same scope, it goes to inherited, and then global scope. I agree that this pretty much renders defaults useless as they have to be global or repeated per class / define. It is only useful if a define or class creates many resources.
If defaults followed lexical scope / (namespaces). Then the defaults would apply to the namespace it is defined in, and all inner namespaces. That would make them more useful while also safe to use. They would not apply to something that is included.
Have no clear opinion on what is best here yet. -henrik -- Visit my Blog "Puppet on the Edge" http://puppet-on-the-edge.blogspot.se/ -- 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/lp501t%24rrv%241%40ger.gmane.org. For more options, visit https://groups.google.com/d/optout.