$ echo 'cat' | trre 'c:da:ot:g'
dog
Feels strange. What is happening here; the grammar says TRRE <- TRRE* TRRE|TRRE TRRE.TRRE
TRRE <- REGEX REGEX:REGEX
What is the parse tree here? Why is "c" not being replaced with "da"? Or why isn't c being removed and "da" being replaced by "ot"?I do like the idea of having a search/replace semantic that is more intuitive than grouping operators; back in MS-DOS days you could do "ren .log .txt" and this would work which feels bananas to my modern bash-minded way of thinking, but it's very obvious looking at this what it is supposed to do.
If the operator were explicit (let’s call it ~), the example would look like this:
$ echo 'cat' | trre 'c:d~a:o~t:g'
dog
With unnecessary parentheses: $ echo 'cat' | trre '(c:d)~(a:o)~(t:g)'
dog
Now I just worry about buying new bowls. Will the bowls fit nicely given pitch and angle of the of the dealies on the rack? The bowls I inherited from my grandmother fit so nicely in any dishwasher I've loaded them into, but now they're starting to crack...
I still try to be somewhat efficient about loading the dishwasher, but… if I notice myself stressing I just say “screw it”, run it, and wash the rest by hand.
The other thing I’ve realized is that sometimes things don’t get clean if you load them properly. For example, tall glasses that had smoothies in them. It’s a little gross if you don’t notice it until you’re about to use it, but… you can just look at them and wash them by hand when you unload the dishwasher.
I guess this is all to say that sometimes the best optimization is to not think about it too much.