It is not possible to call a 4.x function from a 3.x function or ERB template because that logic does not have ready access to a mechanism to perform such a call correctly.
We should add a new method of scope that works the same way as how the puppet language evaluator performs the call. i.e.:
- The call is made with arguments using ruby/4.x semantics (no funny undef stuff)
- If a 4.x function is found it wins
- If a 3.x function is found the arguments are transformed to the 3.x convention (i.e. undef funny stuff).
- in a 3.x version, 4.x. functions are only found if parser==future.
The solution is to add a method call_function on Scope. It accepts the name of a function as its first argument, followed by all arguments in an Array. It also accepts a Ruby block (as a lambda).
escaped and reported from outside: