3 ms·
Disclaimer: entirely off the cuff Although the creator demonstrates this with `*` and `+` I could imagine this being useful within a set of higher level operat
by pentaphobe 4y ago
Disclaimer: entirely off the cuff
Although the creator demonstrates this with `*` and `+` I could imagine this being useful within a set of higher level operators (functions)
eg. perhaps you want an argument of (infix) `map` to evaluate before `map` itself
Or more generally, you might have a bunch of scalar operators which you'd like to have higher precedence than collection operators which should act on the results
- JoachimS 4y agoYes, but tht sounds like something you decide on once. Not, dynamically and more than once. More like "in this function call given these operands, I want '+' to be evaluated before '/'." Or I'm probably missing something.
- pentaphobe 4y agoImagine you're writing a lot of one off solutions (say, for AOC) you may end up building a small set of helpful functions you compose together Being able to customise how they compose (through precedence) lets you build a kind of DSL for your problem space No idea how often that would be used - but I can imagine hobby scenarios