]> gitweb.factorcode.org Git - factor.git/blob - basis/persistent/vectors/vectors-docs.factor
docs: change $subsection to $subsections
[factor.git] / basis / persistent / vectors / vectors-docs.factor
1 USING: help.markup help.syntax kernel math sequences ;
2 IN: persistent.vectors
3
4 HELP: PV{
5 { $syntax "PV{ elements... }" }
6 { $description "Parses a literal " { $link persistent-vector } "." } ;
7
8 HELP: >persistent-vector
9 { $values { "seq" sequence } { "pvec" persistent-vector } }
10 { $description "Creates a " { $link persistent-vector } " with the same elements as " { $snippet "seq" } "." } ;
11
12 HELP: persistent-vector
13 { $class-description "The class of persistent vectors." } ;
14
15 ARTICLE: "persistent.vectors" "Persistent vectors"
16 "A " { $emphasis "persistent vector" } " differs from an ordinary vector (" { $link "vectors" } ") in that it is immutable, and all operations yield new persistent vectors instead of modifying inputs. Unlike immutable operations on ordinary sequences, persistent vector operations are efficient and run in sub-linear time."
17 $nl
18 "The class of persistent vectors:"
19 { $subsections persistent-vector }
20 "Converting a sequence into a persistent vector:"
21 { $subsections >persistent-vector }
22 "Persistent vectors have a literal syntax:"
23 { $subsections POSTPONE: PV{ }
24 "The empty persistent vector, written " { $snippet "PV{ }" } ", is used for building up all other persistent vectors."
25 $nl
26 "This implementation of persistent vectors is based on the " { $snippet "clojure.lang.PersistentVector" } " class from Rich Hickey's Clojure language for the JVM (" { $url "http://clojure.org" } ")." ;
27
28 ABOUT: "persistent.vectors"