I am not sure if I understand you properly, but in my opinion it is possible:
// Add your function to the volt compiler
$compiler->addFunction('square', function($arg) {
return $arg . ' * ' . $arg;
});
// call it in the view:
{% for i in 1..10 %}
{{ i }} - {{ square(i) }}<br/>
{% endfor %}