Let me extend the question also to custom functions. Basically, you call custom functions the same way as built-in functions (using function_ prefix), but make sure you pass all params in an array:
newfunction(:namegoeshere, :type => :rvalue) do |args|
<%= scope.function_namegoeshere(["one","two"]) %>
Please note it also works without the square braces on some Puppet versions. More info: http://docs.puppetlabs.com/guides/custom_functions.html#referencing-custom-functions-in-templates
Another important thing is there is a bug (or feature) in Puppet 2.6 or older where custom functions are not auto-loaded into the template scope. You need to load them manually, otherwise function wont be found!
<% Puppet::Parser::Functions::function('namegoeshere') %>
More info: http://projects.puppetlabs.com/issues/7991