]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/json/reader/reader.factor
sequences: add index-of-last
[factor.git] / basis / json / reader / reader.factor
index b47fada6ba9a3b839c77ad762a0f59552811ad56..a71a36ac092473948305163604b60ee199cb43c1 100644 (file)
@@ -70,7 +70,7 @@ DEFER: (read-json-string)
     [ length 2 - ] [ nth-unsafe ] bi ; inline
 
 : pop-unsafe ( seq -- elt )
-    [ length 1 - ] keep [ nth-unsafe ] [ shorten ] 2bi ; inline
+    index-of-last [ nth-unsafe ] [ shorten ] 2bi ; inline
 
 : check-length ( seq n -- seq )
     [ dup length ] [ >= ] bi* [ json-error ] unless ; inline