On 2014-17-03 14:19, John Bollinger wrote:


On Friday, March 14, 2014 10:48:31 PM UTC-5, henrik lindberg wrote:

      [I wrote:]
     > Such as about scoping function names
     > so that different environments can bind different implementations
    to the
     > same name, maybe.
     >

    There will be support for scoping function names. i.e. you can call

    mymodule::foo(x)

    All such references are currently (albeit still at the idea state)
    absolute names - no shadowing, and no "local functions" are planned.

    Aliasing is being contemplated, which means it is possible to alias
    certain functions.

    alias foo = mymodule::foo

    Which would make all calls to foo() go to mymodule::foo() in the
    .pp file having that alias at the top.



I love the idea of qualified function name, but that's not what I was
talking about.  Puppet currently suffers from a different kind of
scoping problem in that different versions of the same function,
declared with the same name (e.g. by different versions of the same
module) may exist in different environments, but Puppet can only use one
of them -- whichever happens to get loaded first, IIRC.  Qualified
function names do not solve this problem.


The idea to solve that is to limit the visibility of modules that a module does not depend on. This way, the same function (or different versions of it) may be used from different modules.

And naturally, one environment may be different from other environments, only sharing what is identical.

Currently, the implementation of Puppet::Parser::Function prohibits this since it infects Scope. The new Function API and new loaders that we plan to implement for 4.0 will fix this.

- henrik



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

Reply via email to