Closed alrik11es closed 10 years ago
@alrik11es, tnx for this suggestion, Mammouth support now Anonymous functions
echo(preg_replace_callback('~-([a-z])~', (match)->
return(strtoupper(match[1]))
, 'hello-world'))
is compiled to:
echo(preg_replace_callback('~-([a-z])~', function($match) {
return(strtoupper($match[1]));
}, 'hello-world'));
This will be added to npm version v0.2.3 next time.
Is there support for anonymous functions in mammouth?
BTW this looks pretty awesome, if you need some ideas you could take'em from here https://github.com/runekaagaard/snowscript