On Wed, Oct 20, 2010 at 2:19 PM, Markus Roberts <[email protected]>wrote:

> So, ignoring the strawman behind door #2 for the moment, I would argue
> (fairly strongly) that calling lookupvar from all over the place is a real
> problem that should be fixed, especially if those calls are from places not
> easily tied to any particular AST node (in fact, you could make the case
> that, if these are too hard to tie to a particular place in the source the
> whole notion of "static" scoping for them is questionable).
>
> In reality the question to ask is shouldn't these three or four stray users
> really be talking to an AST::Variable instance rather than calling
> lookupvar?
>
> Further, this is the classic rational for introducing global variables; no
> one ever says "hey, it's to easy too determine this value at the call site;
> we should sneak it in with a global rather than passing it as a parameter."
> And it almost never ends well.
>
> As for the method extending trivially to future uses, that's a "we should
> sin now so it's easier to sin in the future" argument.   If we really want
> to have this sort of error-source tracking mechanism it should be owned by
> something (probably the compiler or parser object) rather than being stuffed
> into a thread var, but the general trend has been away from that sort of
> stateful adjunct in general (and the compiler in specific) and towards
> making the process of evaluation purely functional.
>

So what do you think is the best way to improve this patch?

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