(PUP-3978) Pass block using Ruby semantics, not as normal parameter
Passing a block as a normal parameter messed up the notion of
optional parameters since the last parameter could be a required
block. It also made the calling convention somewhat unorthodox
from a ruby developers point of view.
This commit introduces a new class 'PuppetProc' derived from the Ruby
'Proc'. It wrapps the normal closure that would otherwise be passed in
a parameter and enables it to instead be passed as a block, thus
making it possible to use standard calls like 'block_given?' and
'yield' to execute a Puppet lambda from Ruby.
The 'TypeCalculator' will infer a 'PuppetProc' to the type of its
closure. It is also capable of inferring a normal ruby 'Proc' using the
information returned by its 'parameters' method so that all parameters
are of type 'Any' and the min/max is controlled by the :req, :opt, and
:rest indicators of the parameter info arrays.