On Oct 12, 2010, at 3:51 PM, Paul Berry wrote: > On Tue, Oct 12, 2010 at 3:41 PM, Luke Kanies <[email protected]> wrote: > On Oct 12, 2010, at 2:22 PM, Nigel Kersten wrote: > > > On Tue, Oct 12, 2010 at 2:17 PM, Markus Roberts <[email protected]> > > wrote: > >> > >>>> Hmm, the number of people chiming in on this topic is making me wonder > >>>> whether we are barking up the wrong tree with lexical scoping. If people > >>>> don't need for variables and resource defaults defined in a class to take > >>>> effect in contained classes, then there's no sense in our going to extra > >>>> work to support it. > >>>> > >>> > >>> Can we drop both lexical and dynamic scoping and still keep this property: > >>> > >>>>>> 1. Variables defined at toplevel can be seen inside classes. For > >>>>>> example: > >>>>>> $var = "value" > >>>>>> class foo { notify { $var: } } > >>>>>> include foo > >>>>>> > >>>> This is a good idea and should stay, short and long term. > >> > >> Q: Can we drop both lexical and dynamic scoping and still keep the property > >> "Variables defined at toplevel can be seen inside classes"? > >> > >> A: Yes. Globals don't require scoping. :P > > > > Do we need scoping for inherited classes to inherit resource defaults > > and variables? > > Yes, but would it be acceptable to remove that and rely on the mixin-like > behaviour I mentioned earlier instead? > > I think the discussion is boiling down to four fundamental questions that > we're achieving consensus on. Let me try to state what I think those > questions are, and the consensus I'm hearing: > > (a) Do we want to remove dynamic scoping from Puppet (variables and resource > defaults defined in class A also take effect in classes that A includes)? > Yes. But we should remove it carefully and with appropriate warnings, so > that users have time to adapt their manifests to use parameterized classes > etc. And we may need to add Luke's proposed "extend" concept to address some > of the use cases of resource defaults. (Personally, I think we have enough > of a consensus that we could move forward with this, and consider the > "extend" concept something to be elaborated during the timeframe of 2.7 > development.) > > (b) Do we want to add lexical scoping to Puppet (variables and resource > defaults defined in class A also take effect in classes nested inside class > A, e.g. A::B)? No. I thought we did when we began this discussion, but I > think this was because I initially misunderstood the decision as "lexical > scoping or dynamic scoping?" What I'm hearing today is that we don't need > either of them. > > (c) Do we want to remove inherited scoping from Puppet (variables and > resource defaults defined in class A also take effect in classes derived from > A)? No. This is a useful feature and should be kept. > > (d) Do we want to remove globals from Puppet (variables and resource defaults > defined at toplevel also take effect inside classes)? No. This is a useful > feature and should be kept.
This is a fantastic simplification and summary of the questions. Without adding mixin/extend functionality we lose real functionality, but I'm not sure if it'll actually be used that much. -- The one thing more difficult than following a regimen is not imposing it on others. -- Marcel Proust --------------------------------------------------------------------- Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199 -- 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.
