]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/documents/documents.factor
sequences: add index-of-last
[factor.git] / basis / documents / documents.factor
index 65a20ab66bcbe0f70d51426500c09b5574df1c5c..6e02a734caa0d9137c588387079b3bae5c135d90 100644 (file)
@@ -88,7 +88,7 @@ CONSTANT: doc-start { 0 0 }
     0 swap [ append ] change-nth ;
 
 : append-last ( str seq -- )
-    [ length 1 - ] keep [ prepend ] change-nth ;
+    index-of-last [ prepend ] change-nth ;
 
 : loc-col/str ( loc document -- str col )
     [ first2 swap ] dip nth swap ;