sequences.extras: adding map-index!.

db4
John Benediktsson 2012-08-08 20:07:38 -07:00
parent 2e9c20a12e
commit 3f11990452
1 changed files with 3 additions and 0 deletions
extra/sequences/extras

View File

@ -224,3 +224,6 @@ PRIVATE>
[ find ] 2keep rot [
[ 1 + ] 2dip find-from drop not
] [ 3drop f ] if ; inline
: map-index! ( ... seq quot: ( ... elt index -- ... newelt ) -- ... seq )
over [ [ (each-index) ] dip collect ] keep ; inline