> We’re also going to introduce a concatenation function called “cat”.
>

Note there is already a concatenation operator in puppet (from
lib/puppet/parser/ast/leaf.rb):


  class Concat < AST::Leaf
    def evaluate(scope)
      @value.collect { |x| x.evaluate(scope) }.collect{ |x| x ==
:undef ? '' : x }.join
    end

    def to_s
      "concat(#{@value.join(',')})"
    end
  end


We just don't expose the syntax directly; instead of

cat(template("a.erb"), template("b.erb")

you write:

"${template("a.erb")}${template("b.erb")}"

and this is internally processed as a concatenation...so what you're
suggesting is just a syntax-desugaring.

Also, having templates chain scope is, IMHO, a bug/misfeature, but that's
really a separate issue..

-- M
-----------------------------------------------------------
When in trouble or in doubt, run in circles,
scream and shout. -- 1920's parody of the
maritime general prudential rule
------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to