]> gitweb.factorcode.org Git - factor.git/blob - basis/columns/columns-docs.factor
Create basis vocab root
[factor.git] / basis / columns / columns-docs.factor
1 USING: help.markup help.syntax sequences ;
2 IN: columns
3
4 ARTICLE: "columns" "Column sequences"
5 "A " { $emphasis "column" } " presents a column of a matrix represented as a sequence of rows:"
6 { $subsection column }
7 { $subsection <column> } ;
8
9 HELP: column
10 { $class-description "A virtual sequence which presents a fixed column of a matrix represented as a sequence of rows. New instances can be created by calling " { $link <column> } "." } ;
11
12 HELP: <column> ( seq n -- column )
13 { $values { "seq" sequence } { "n" "a non-negative integer" } { "column" column } }
14 { $description "Outputs a new virtual sequence which presents a fixed column of a matrix represented as a sequence of rows." "The " { $snippet "i" } "th element of a column is the " { $snippet "n" } "th element of the " { $snippet "i" } "th element of " { $snippet "seq" } ". Every element of " { $snippet "seq" } " must be a sequence, and all sequences must have equal length." }
15 { $examples
16     { $example
17         "USING: arrays prettyprint columns ;"
18         "{ { 1 2 3 } { 4 5 6 } { 7 8 9 } } 0 <column> >array ."
19         "{ 1 4 7 }"
20     }
21 }
22 { $notes
23     "In the same sense that " { $link <reversed> } " is a virtual variant of " { $link reverse } ", " { $link <column> } " is a virtual variant of " { $snippet "swap [ nth ] curry map" } "."
24 } ;
25
26 ABOUT: "columns"