/vlist

VList data structure

Primary LanguageGo

VList

A VList is an ordered list data structure.

See http://en.wikipedia.org/wiki/VList, or http://infoscience.epfl.ch/record/64410/files/techlists.pdf, "Fast Functional Lists, Hash-Lists, Deques and Variable Length Arrays", Phil Bagwell.

This is a simple example, originally written for Rosetta Code. It could be built upon in various ways, for example:

  • A copy function.
  • Go-like slicing and appending.
  • More Lisp-like functions.
  • More efficient representation. Probably with the unsafe package, ideas from the Bagwell paper could be implemented.