On Monday, February 1, 2016 at 12:15:12 PM UTC-6, henrik lindberg wrote: Contrast this with the inline_epp, which you can think of as a > lambda/code-block. Here the code block gets to see the variables in > scope, since it is itself in that scope (part of the same piece of code). > >
Hmmm. The docs <https://docs.puppetlabs.com/puppet/latest/reference/lang_template_epp.html#special-scope-rule-for-inlineepp> cast that behavior of inline_epp() as a special exception, and claim it's applicable only when the template declares no parameters and you don't pass any (and only with inline_epp()). Are the docs wrong? If they are correct, then surely it is best to view that exception *as* an exception, not as some sort of natural consequence of the scope in which the template or the inline_epp() call appears. In fact, inasmuch as the template might be presented in the form of a variable defined in a different scope, drawing its actual value from who-knows-where, I really think it's confusing to assert that such an exception is a natural extension of Puppet's scoping rules. Call it what it is: an ease-of-use aid applicable only to cases where the stricter ordinary scoping rules of EPP templates are of little advantage. John -- 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 puppet-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/02150181-1b5d-47a6-b2a4-4ebb3f8a6f98%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.