On Sep 16, 2010, at 6:12 PM, Jeff McCune wrote:

> On Thu, Sep 16, 2010 at 4:03 PM, Nigel Kersten <[email protected]> wrote:
>> On Thu, Sep 16, 2010 at 12:49 PM, Jeff McCune <[email protected]> wrote:
> [snip]
>>> Also, please keep in mind this entire discussion applies to resource
>>> defaults as well.  Whatever behavior we implement for variables should
>>> also be implemented for resource defaults.
>> 
>> So the plan is that the only place you can reliably set global
>> resource defaults is directly in your site.pp or in an *import* from
>> site.pp ?
>> 
>> and thus not inside a class that may include all your other classes?
>> (we have a module 'base' that does all the logic for which other
>> classes should be included)
>> 
> 
> Yeah, so I forgot about this...  I rather like being able to do that
> and we should definitely preserve the feature.
> 
> I brought this up awhile ago on puppet-users and the thread died
> pretty quickly with no resolution, which is the thread Nan linked to
> above.
> 
> I think we may be approaching this from the wrong angle.  What if
> instead of throwing dynamic scoping out the window, we flatten the
> class tree?  We change the default behavior of include to attach
> classes to the root of the tree and give the user the option to attach
> the class somewhere else.
> 
> If the same class is attached to the tree in two different locations,
> throw and error.
> 
> Leave scoping as it is, all of the issues will go away since the class
> tree is now shallow, broad, and the user must go out of their way to
> use or abuse the dynamic scoping behavior.

That's basically lexical scoping, with optional dynamic scoping. :)  Sounds 
like a recipe for massive confusion.

I think the language has advanced to the point where the dynamic scoping isn't 
really needed except maybe in resource defaults -- external data sources and 
fully qualified variables get you there much better.  Yes, it would be a big 
shift for people, but I don't think it would result in losing data.

And really, if you just named that class 'main' instead of base, all of those 
options would be functionally global anyway. :)

-- 
This space intentionally has nothing but text explaining why this
space has nothing but text explaining that this space would otherwise
have been left blank, and would otherwise have been left blank.
---------------------------------------------------------------------
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.

Reply via email to