]> gitweb.factorcode.org Git - factor.git/blob - core/search-dequeues/search-dequeues-docs.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / core / search-dequeues / search-dequeues-docs.factor
1 IN: search-dequeues
2 USING: help.markup help.syntax kernel dlists hashtables
3 dequeues assocs ;
4
5 ARTICLE: "search-dequeues" "Search dequeues"
6 "A search dequeue is a data structure with constant-time insertion and removal of elements at both ends, and constant-time membership tests. Inserting an element more than once has no effect. Search dequeues implement all dequeue operations in terms of an underlying dequeue, and membership testing with " { $link dequeue-member? } " is implemented with an underlying assoc. Search dequeues are defined in the " { $vocab-link "search-dequeues" } " vocabulary."
7 $nl
8 "Creating a search dequeue:"
9 { $subsection <search-dequeue> }
10 "Default implementation:"
11 { $subsection <hashed-dlist> } ;
12
13 ABOUT: "search-dequeues"
14
15 HELP: <search-dequeue> ( assoc dequeue -- search-dequeue )
16 { $values { "assoc" assoc } { "dequeue" dequeue } { "search-dequeue" search-dequeue } }
17 { $description "Creates a new " { $link search-dequeue } "." } ;
18
19 HELP: <hashed-dlist> ( -- search-dequeue )
20 { $values { "search-dequeue" search-dequeue } }
21 { $description "Creates a new " { $link search-dequeue } " backed by a " { $link dlist } ", with a " { $link hashtable } " for fast membership tests." } ;