Maybe adding a bolean (optional) "-persist" flag to
db_list_of_ns_sets would be a good thing. That way you could make it call "
ns_set copy -persist $selection" internally, or without -persist if you leave out the flag.
list_users_not_cached should also take the optional -persist flag, and the flag should be provided when it gets called from a memoization statement.
We would be able to do without my hack above if we implement it this way, I think.
The persistent ns_set needs to be freed at some point, but I haven't thought about that part so much yet... Some help here would be appreciated😊