Zig: proposal: rename List to Vector in standard library

Created on 2 May 2017  路  3Comments  路  Source: ziglang/zig

several people now have commented that they expected List to be a linked list, when it is actually contiguous memory. @thejoshwolfe, do you have a suggestion for how to name all the containers that we expect to find in the standard library?

  • LinkedList
  • IntrusiveLinkedListNode?
  • HashMap
  • Vector
  • Buffer
  • BufMap
  • BufSet
  • anything else?
accepted breaking proposal

All 3 comments

I'm building up a little collection of generic data structures:

  • ArrayList
  • Queue / Deque
  • SortedArray
  • LinkedList / DoublyLinkedList
  • Set / BloomFilter
  • Trie

As soon as they're idiomatic I can start sending pull requests if you'd like

These sound like good candidates for the standard library to me. I agree with your proposal to name it ArrayList instead of Vector.

361 added a generic linked list which is doubly linked. I think it makes sense to only provide a doubly linked list. if users want a singly linked list they can make one themselves or use a third party one using the vaporware package system.

Was this page helpful?
0 / 5 - 0 ratings