]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/sequences/extras/extras-docs.factor
sequences.extras: move ??nth
[factor.git] / extra / sequences / extras / extras-docs.factor
index f1a2d822c41988e4a10303ecc8a9797bd7dbdd1a..c9944b4dd4a7ac35e4c785ede2b4971e4aacaf3d 100644 (file)
@@ -1074,6 +1074,10 @@ HELP: nth?
 }
 { $description "Check if the nth element of " { $snippet "seq" } " satisfies the condition given by " { $snippet "quot" } "." } ;
 
+HELP: ??nth
+{ $values { "n" integer } { "seq" sequence } { "elt/f" { $maybe object } } { "?" boolean } }
+{ $description "A forgiving version of " { $link nth } ". If the index is out of bounds, or if the sequence is " { $link f } ", simply outputs " { $link f } ". Also outputs a boolean to distinguish between the sequence containing an " { $link f } " or an out of bounds index." } ;
+
 HELP: odd-indices
 { $values
     { "seq" sequence }