Fix documentation for map-index
parent
1040426565
commit
d707292d84
|
@ -311,7 +311,7 @@ HELP: each-index
|
|||
|
||||
HELP: map-index
|
||||
{ $values
|
||||
{ "seq" sequence } { "quot" quotation } }
|
||||
{ "seq" sequence } { "quot" quotation } { "newseq" sequence } }
|
||||
{ $description "Calls the quotation with the element of the sequence and its index on the stack, with the index on the top of the stack. Collects the outputs of the quotation and outputs them in a sequence of the same type as the input sequence." }
|
||||
{ $examples { $example "USING: sequences prettyprint math ;"
|
||||
"{ 10 20 30 } [ + ] map-index ."
|
||||
|
|
|
@ -506,7 +506,7 @@ PRIVATE>
|
|||
[ [ 0 = ] 2dip if ] 2curry
|
||||
each-index ; inline
|
||||
|
||||
: map-index ( seq quot -- )
|
||||
: map-index ( seq quot -- newseq )
|
||||
prepare-index 2map ; inline
|
||||
|
||||
: reduce-index ( seq identity quot -- )
|
||||
|
|
Loading…
Reference in New Issue