On 2016-02-02 21:15, John Bollinger wrote:

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

The docs are wrong. I have filed a ticket.

The behavior is specified here https://github.com/puppetlabs/puppet-specifications/blob/master/language/templates.md#visibility-of-scoped-variables

The implementation works as specified.

Best
- henrik

<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
<mailto: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
<https://groups.google.com/d/msgid/puppet-dev/02150181-1b5d-47a6-b2a4-4ebb3f8a6f98%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
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/n8vjvv%248b0%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to