3 ms·
Regex one stands out as a negative example here. Why does it have to be built-in instead of exposing a str -> bool filter lambda?
by lostmsu 2y ago
Regex one stands out as a negative example here. Why does it have to be built-in instead of exposing a str -> bool filter lambda?
- mirashii 2y agoNow you need a general purpose embedded language interpreter to express your filter lambda? I'm not sure you've really made anything simpler.
- rowanG077 2y agoI don't see why you want an embedded interpreter for this. Can you explain?
- tempodox 2y agoIf you give a lambda to cargo-watch instead of a regexp, it has to be evaluated. Hence interpreter.
- rowanG077 2y agoWhy would you evaluate it using an interpreter? Since you are using it in the context of a rust lambda you compile it. You just have a rust file that calls cargo-watch as a library. Crafting an interpreter seems like an incredibly bad idea.
- mirashii 2y agoBut now you have to know at compile time what you're watching, which is not what cargo-watch or any of the similar commands like entr do.
- sethaurus 2y agoHow does one pass a lambda to a CLI tool? Outside of using a regex or equivalent pattern syntax, I'm struggling to understand what you are proposing here.
- lostmsu 2y agoThis is in a context of file watching library. Although I'm not sure cargo-watch supports or even needs to support regex.