]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences.extras: adding change-last and change-last-unsafe.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 12 Oct 2013 23:40:51 +0000 (16:40 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 12 Oct 2013 23:40:51 +0000 (16:40 -0700)
extra/pdf/layout/layout.factor
extra/sequences/extras/extras.factor

index d2177f63db52de4c205e1976df28f29f5eaff794..d509bca78fcace5ec2771e42f851bdd8666f540e 100644 (file)
@@ -4,7 +4,8 @@
 USING: accessors assocs calendar combinators environment fonts
 formatting fry io io.streams.string kernel literals locals make
 math math.order math.ranges pdf.canvas pdf.values pdf.wrap
-sequences sorting splitting ui.text xml.entities ;
+sequences sequences.extras sorting splitting ui.text
+xml.entities ;
 FROM: assocs => change-at ;
 FROM: sequences => change-nth ;
 FROM: pdf.canvas => draw-text ;
@@ -245,9 +246,6 @@ M: table-row pdf-render
         ] [ 0 ] if*
     ] map nip ;
 
-: change-last ( seq quot -- )
-    [ drop length 1 - ] [ change-nth ] 2bi ; inline
-
 :: max-col-widths ( canvas rows -- widths )
     H{ } clone :> widths
     rows [
index f620216c815a5e38ac6444cbb567a8c2f7f943f0..2e3202184639694e8b6f070abb6c3827ea2bbac7 100644 (file)
@@ -521,3 +521,9 @@ PRIVATE>
 
 : reject! ( ... seq quot: ( ... elt -- ... ? ) -- ... subseq )
     [ not ] compose filter! ; inline
+
+: change-last ( seq quot -- )
+    [ drop length 1 - ] [ change-nth ] 2bi ; inline
+
+: change-last-unsafe ( seq quot -- )
+    [ drop length 1 - ] [ change-nth-unsafe ] 2bi ; inline