Jump to content

VList: Difference between revisions

Line 383:
MODULE RosettaVLists;
(** In 2002, Phil Bagwell published "Fast Functional Lists" which introduced VLists as alternatives to Functional Programming's
ubiquitous linked lists and described Visp (a dialect of Common Lisp) using VLists, but including a "foldr" function, optimized to use VLists. VLists have the same properties as immutable functional linked lists (including full persistence); but, unlike a linked list, with O(1) random access time. The VLists implemented here is based on section 2.1 of that article but has been modified to retain the safety features of Component Pascal.
optimized to use VLists. VLists have the same properties as immutable functional linked lists (including full persistence); but,
unlike a linked list, with O(1) random access time. The VLists implemented here is based on section 2.1 of that article but has been
modified to retain the safety features of Component Pascal.
 
VLists are referenced through 2 fields: "base" and "offset". A third field "length" reduces the time to determine its length to O(1).
 
Methods provided for manipulating VLists are named after their corresponding Visp functions, but follow Component Pascal's case conventions. **)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.