]> gitweb.factorcode.org Git - factor.git/blob - basis/columns/columns-docs.factor
Support Link Time Optimization (off by default)
[factor.git] / basis / columns / columns-docs.factor
1 USING: help.markup help.syntax sequences ;
2 IN: columns
3
4 HELP: column
5 { $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> } "." } ;
6
7 HELP: <column>
8 { $values { "seq" sequence } { "col" "a non-negative integer" } { "column" column } }
9 { $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." }
10 { $examples
11     { $example
12         "USING: arrays prettyprint columns ;"
13         "{ { 1 2 3 } { 4 5 6 } { 7 8 9 } } 0 <column> >array ."
14         "{ 1 4 7 }"
15     }
16 }
17 { $notes
18     "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" } "."
19 } ;
20
21 HELP: <flipped>
22 { $values { "seq" sequence } { "seq'" sequence } }
23 { $description "Outputs a new virtual sequence which presents the transpose of " { $snippet "seq" } "." }
24 { $notes "This is the virtual sequence equivalent of " { $link flip } "." } ;
25
26 ARTICLE: "columns" "Column sequences"
27 "A " { $emphasis "column" } " presents a column of a matrix represented as a sequence of rows:"
28 { $subsections
29     column
30     <column>
31 }
32 "A utility word:"
33 { $subsections <flipped> } ;
34
35 ABOUT: "columns"