Whole-known-network
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> (an abstraction for solving this problem on general strings would not be useful for me because if I eventually solve it, I will do it on the *specific* strings held by this text entry library, and that text entry library both (1) can make stronger guarantees than are possible on general strings, since it alone has permission to mutate the strings (2) probably is using a wrong abstraction for strings already because their current system will become unperformant on long single lines)</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> no. But if I wind up rewriting this tui text library in the next couple months I'd appreciate if I could ask your advice.</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> should i get sniped by this for the next half a hour?</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> i *think* you can consume that borrow and the string in the operation</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> however, there's still one problem: you need to make sure you don't get wedged in a situation where you have one immutable borrow left, and you want to use exactly that index to tell the string to perform a mutation at a position… but you can't mutate because the index you are "turning in" to request the mutation is holding a borrow. Maybe the borrow checker already has rules smart enough to prevent this being a problem. I am still perpetually surprised by the borrow checker</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> *thinks*</p><p>You're right. I'm thinking about this wrong. Thanks.</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> you can have multiple immutable borrows, no?</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@film_girl" class="u-url mention">@<span>film_girl</span></a></span> There is always cake at the Sky Club</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> so maybe what would work is an Indexer that can vend multiple live indices and the Indexer holds the borrow? Not sure</p>