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'm assuming that the brainteaster part is that the definitions are lazy 
evaluated but the classes aren't.

-- 
Luke Kanies | http://about.me/lak | http://puppetlabs.com/ | +1-615-594-8199
Join us at PuppetConf 2013, August 22-23 in San Francisco - 
http://bit.ly/pupconf13

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