From 4968a4f6a5c20bde6028babc873744fc0515faab Mon Sep 17 00:00:00 2001 From: Alexander Iljin Date: Fri, 17 Feb 2017 01:47:16 +0300 Subject: [PATCH] sequences-docs: add a bunch of related-words --- core/sequences/sequences-docs.factor | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index c80d0b1a3c..1ba61d0d0b 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -678,7 +678,7 @@ HELP: replace-slice { $description "Replaces a range of elements beginning at index " { $snippet "from" } " and ending before index " { $snippet "to" } " with a new sequence." } { $errors "Throws an error if " { $snippet "new" } " contains elements whose types are not permissible in " { $snippet "seq" } "." } ; -{ push prefix suffix } related-words +{ push push-either push-if pop pop* prefix suffix suffix! } related-words HELP: suffix { $values { "seq" sequence } { "elt" object } { "newseq" sequence } } @@ -758,8 +758,6 @@ HELP: last { $description "Outputs the last element of a sequence." } { $errors "Throws an error if the sequence is empty." } ; -{ pop pop* } related-words - HELP: pop* { $values { "seq" "a resizable mutable sequence" } } { $description "Removes the last element and shortens the sequence." } @@ -908,7 +906,7 @@ HELP: append-as } } ; -{ append append-as } related-words +{ append append-as append! 3append 3append-as push-all } related-words HELP: prepend { $values { "seq1" sequence } { "seq2" sequence } { "newseq" sequence } } @@ -963,8 +961,6 @@ HELP: 3append-as } } ; -{ 3append 3append-as } related-words - HELP: surround { $values { "seq1" sequence } { "seq2" sequence } { "seq3" sequence } { "newseq" sequence } } { $description "Outputs a new sequence with " { $snippet "seq1" } " inserted between " { $snippet "seq2" } " and " { $snippet "seq3" } "." } @@ -1109,6 +1105,12 @@ HELP: tail* } { $errors "Throws an error if the index is out of bounds." } ; +{ tail tail* tail-slice tail-slice* } related-words +{ head head* head-slice head-slice* } related-words +{ cut cut* cut-slice } related-words +{ unclip unclip-slice unclip-last unclip-last-slice } related-words +{ first last but-last but-last-slice rest rest-slice } related-words + HELP: shorter? { $values { "seq1" sequence } { "seq2" sequence } { "?" boolean } } { $description "Tests if the length of " { $snippet "seq1" } " is smaller than the length of " { $snippet "seq2" } "." } ; -- 2.34.1