(To add my voice to the chorus)

On 16 Sep 2010, at 12:49 PM, Jeff McCune wrote:
> On Thu, Sep 16, 2010 at 3:36 PM, Luke Kanies <[email protected]> wrote:
>> On Sep 16, 2010, at 12:45 PM, Paul Berry wrote:
>>> 1. Variables defined at toplevel can be seen inside classes.
>> 
>> This is a good idea and should stay, short and long term.
> 
> Agreed.
> 
> 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.

Agreed on both counts.

>> From this on down, we're basically dealing with dynamic scoping, and in 
>> general, I think it should be fixed, and by fixed, I essentially mean 
>> removed.
> 
> Yes, I think this behavior should be completely eliminated.  Many new people 
> are extremely surprised by this behavior when the first learn of it.
> 
> It also causes many, many problems and provides little benefit in my 
> experience.

Actually I do take advantage of this quirky dynamic scoping *a lot* in 0.25, 
but that's to do the work of parameterized classes.  I haven't played with them 
enough, since we're still a little ways off from migrating to 2.6.1+, but I 
agree that efforts should be focused on making those work sensibly.

> If a class includes another class and the child needs access to a variable in 
> the default, if we must allow this behavior, we could do it with namespace 
> notation rather than scoping.


-- 
Ian Ward Comfort <[email protected]>
Systems Team Lead, Academic Computing Services, Stanford University

-- 
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