Youssef Shoaib [MOD]04/25/2023, 5:52 AM
types that are mutable vectors, and I'm struggling to find a name for a new read-only Vector type that they should implement. I'm thinking maybe
but it seems to be too long. The issue is that changing the name of
would be a big change, especially considering that most Vec-based code would be using mutability, while the read-only versions likely will be used to specify that method parameters and results can't be modified. I also thought maybe
could be an apt name since the interface would really only define the `val`s required to represent that vector, but it still doesn't seem elegant enough
Emil Kantis04/25/2023, 5:59 AM
imo. Its not really that long imo, and IDEs should complete most of it for you anyway.
Youssef Shoaib [MOD]04/25/2023, 6:01 AM
but it's misleading because the type won't actually be immutable.
Ruckus04/25/2023, 6:10 AM
could work (or another word like preview, window, copy, etc).
Youssef Shoaib [MOD]04/25/2023, 6:32 AM
as a way of getting a live-updated vector. The more I think about it, the better the name works. I could then have
for the read-write version of that type that basically internally holds a bijection of sorts to convert back and forth. I think I'm gonna go with
unless I get an epiphany of a better name. Thank you!
mcpiroman04/25/2023, 8:48 AM
ephemient04/26/2023, 1:34 AM
you want, and then maybe give a shorter name to the most common one of them
UnmodifiableFoo |- MutableFoo \- ImmutableFoo \- PersistentFoo
(which it calls
, with `ImmutableList`/`PersistentList` being supplied by
which is also a choice you could make
scala.collection.Seq |- scala.collection.mutable.Seq \- scala.collection.immutable.Seq