On Tue, Nov 17, 2009 at 12:57 AM, David Schmitt <da...@dasz.at> wrote:
> > Markus Roberts wrote: > > > > It'd be great if you could abolish the parse-order dependency > > > > > altogether. As long as all variable/value reference chains form a > > > directed acylcic graph, they could be evaluated after finishing > the > > > parse, regardless of order. > > > > Could you elaborate on this? > > > > > The best I can think of is to do something like store a reference > > > to a variable and a scope during compilation, and then only deref > > > them when we're converting the catalog at the last minute. > > > > That's basically it; the more general form is to use the futures (aka > > promises) mentioned earlier in this thread. Instead of stashing a > > (variable,scope) reference you create a placeholder object which either > > holds a value or the tree to evaluate to get that value. > > > > After parsing is done (and the full forest is known) you fulfill all > > futures that contain values, than iteratively fulfill all futures which > > only depend on fulfilled values. If it's a DAG, you're set. If there > > are loops, you'll be left with unfulfillable nodes and it's an error. > > Yes. You make it sound so easy :-) I'm worried because this also affects > function evaluation including include() and template(), both of which > might alter the manifest significantly, including autoloading new stuff. > This would no doubt change the behavior of function evaluation, but in return bring a higher level of consistency by removing some of the odd ordering/scope abuses that manifest developers sometimes employ. No doubt it will require some folks to refactor their Puppet code. > > Not saying it can't be done, just that it is really a sweeping change > through many parts of the language. > I wouldn't call the change sweeping as much as a targeted extraction of one of the more confusing and inconsistent aspects of the Puppet language. > Regards, DavidS > > -teyo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---