On Tue, 2013-07-23 at 23:23 -0700, Luke Kanies wrote:
> On Jul 23, 2013, at 7:28 PM, Andy Parker <[email protected]> wrote:
> 
> > Going through the compiler today I came across something that I
> > already knew, but one of the new developers here (Kylo Ginsberg,
> > have you met him yet?) didn't. So here is a little brainteaser.
> > Without running this in puppet, what order are the notices printed?
> > 
> > 
> > define foo() {
> >   notice("1 evaluating foo")
> >   baz { "testing": }
> >   notice("2 after declaring baz")
> > }
> > 
> > 
> > define baz() {
> >   notice("3 evaluating baz")
> > }
> > 
> > 
> > class quux() {
> >   notice("4 evaluating quux")
> > }
> > 
> > 
> > class bar() {
> >   notice("5 evaluating bar")
> >   foo { "testing": }
> >   notice("6 after declaring bar")
> >   class {"quux": }
> >   notice("7 after declaring quux")
> > }
> > 
> > 
> > class { "bar": }
> 
> 
> Hmm.  I'll make a go.  (Note that I've been drinking at our OSCON
> party, so…)
> 
> 
> 5647123

I'd say the same. If I remember correctly class code is evaluated when
included, but definitions are done in a separate pass.

-- 
Brice Figureau
Follow the latest Puppet Community evolutions on www.planetpuppet.org!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-dev.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to