We can do something more clever, like creating an Output<bool> (or equivalent) where writes to chars just confirm that the char is the next one we expect, resetting as appropriate.
This is not completely trivial (because of substring fun), but would make a good coding interview question. :joy:
The gain would just be that we don't need to allocate and write the full string.
We can do something more clever, like creating an
Output<bool>
(or equivalent) where writes to chars just confirm that the char is the next one we expect, resetting as appropriate.This is not completely trivial (because of substring fun), but would make a good coding interview question. :joy:
The gain would just be that we don't need to allocate and write the full string.