dashbitco / nimble_parsec

A simple and fast library for text-based parser combinators

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support anonymous functions

hexedpackets opened this issue · comments

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.

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).