Support anonymous functions
hexedpackets opened this issue · comments
William commented
The various combinators that work on functions (map
, post_traversal
, reduce
, etc) all require a named function as an argument. Would it be possible to allow passing in an anonymous function instead? Having to define a function for one-offs can get annoying quickly.
José Valim commented
The way the library was designed is that parsers are combined at compilation time. So we can't use anonymous functions because anonymous functions at compile-time won't survive to runtime. So the current approach is annoying but essential to how the library works (and how the library works is essential to its performance).