Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup privacy on data structures #61

Open
Tko1 opened this issue May 17, 2020 · 0 comments
Open

Cleanup privacy on data structures #61

Tko1 opened this issue May 17, 2020 · 0 comments

Comments

@Tko1
Copy link
Member

Tko1 commented May 17, 2020

Structures like PersistentList (and especially ones like PersistentVector, which will internally change) should not have public internals, and should be interacted with through their public interface; we have already had one potential bug where the cached count was used in PersistentList in an impossible scenario (ie, we were matching on the case of PersistentList(_,_,count = 0) , which would actually never happen, as an empty list would be expressed as PersistentList::Empty)

Off top of my head, need to:

  1. Make counting always read with len
  2. Use cons to attached a head to a tail
  3. Convert PersistentVector into Vector explicitly, rather than doing so by cloning its internal vals Vector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant