factor/library/collections/virtual-sequences.facts

15 lines
921 B
Plaintext
Raw Normal View History

2006-01-02 00:51:03 -05:00
USING: help sequences ;
HELP: <slice> "( m n seq -- slice )"
{ $values { "m" "a non-negative integer" } { "n" "a non-negative integer" } { "seq" "a sequence" } { "slice" "a slice" } }
{ $description "Outputs a new virtual sequence sharing storage with the subrange of elements in " { $snippet "seq" } " with indices starting from and including " { $snippet "m" } ", and up to but not including " { $snippet "n" } "." }
{ $errors "Throws an error if " { $snippet "m" } " or " { $snippet "n" } " is out of bounds." } ;
2006-05-14 23:25:34 -04:00
HELP: reverse "( seq -- reversed )"
{ $values { "seq" "a sequence" } { "reversed" "a sequence" } }
{ $description "Outputs a new sequence with the reverse element order." } ;
HELP: <reversed> "( seq -- reversed )"
{ $values { "seq" "a sequence" } { "reversed" "a sequence" } }
{ $description "Outputs a virtual sequence sharing storage with " { $snippet "seq" } " but with reverse element order." } ;