]> gitweb.factorcode.org Git - factor.git/commitdiff
extra: use [-] instead of "- 0 max".
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 6 Mar 2013 02:17:17 +0000 (18:17 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 6 Mar 2013 02:17:17 +0000 (18:17 -0800)
extra/hamurabi/hamurabi.factor
extra/pdf/canvas/canvas.factor
extra/pdf/layout/layout.factor
extra/sequences/extras/extras.factor
extra/units/reduction/reduction.factor

index d0d7291d99cec0dd21c7e3579dc295abfd0ff565..812733d98c04dcd4dcf86d2eee765d8dfe572547 100644 (file)
@@ -58,7 +58,7 @@ total-births total-deaths ;
     } cleave 100 /i 1 + ;
 
 : #starved ( game -- n )
-    [ population>> ] [ feed>> 20 /i ] bi - 0 max ;
+    [ population>> ] [ feed>> 20 /i ] bi [-] ;
 
 : leave-fink ( -- )
     "DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY" print
index 588c37db6d901294a4f0091564450ccb1a5edcee..c3d9d9a88c1f2b8a71c05ea565a12bacc3caaded 100644 (file)
@@ -106,10 +106,10 @@ foreground background page-color inset line-height metrics ;
     [ 0 >>x ] dip [ dup line-break ] times drop ;
 
 : avail-width ( canvas -- n )
-    [ width ] [ x>> ] bi - 0 max ;
+    [ width ] [ x>> ] bi [-] ;
 
 : avail-height ( canvas -- n )
-    [ height ] [ y>> ] bi - 0 max ;
+    [ height ] [ y>> ] bi [-] ;
 
 : avail-lines ( canvas -- n )
     [ avail-height ] [ line-height>> ] bi /i ; ! FIXME: 1 +
index d9ff982c53d8cf1ae5d32f0f397e6c684ba20a9e..d2177f63db52de4c205e1976df28f29f5eaff794 100644 (file)
@@ -256,7 +256,7 @@ M: table-row pdf-render
     ] each widths >alist sort-keys values
 
     ! make last cell larger
-    dup sum 400 swap - 0 max [ + ] curry dupd change-last
+    dup sum 400 swap [-] [ + ] curry dupd change-last
 
     ! size down each column
     dup sum dup 400 > [ 400 swap / [ * ] curry map ] [ drop ] if ;
index e98ba174751beba1e10e986b0243988f5df2bf43..859d8e9b4169f4a93f930d2351bbf50f8837225f 100644 (file)
@@ -177,7 +177,7 @@ IN: sequences.extras
 <PRIVATE
 
 : ((each-from)) ( i seq -- n quot )
-    [ length over - 0 max swap ] keep '[ _ + _ nth-unsafe ] ; inline
+    [ length over [-] swap ] keep '[ _ + _ nth-unsafe ] ; inline
 
 : (each-from) ( i seq quot -- n quot' ) [ ((each-from)) ] dip compose ;
     inline
index 6f67f163faab6d4e9227faa76f552bc68ac32d8b..db7d774b4f085c7abb95ff9f22132b596bc7a512 100644 (file)
@@ -18,7 +18,7 @@ CONSTANT: unit-suffix-hash H{
 :: find-unit-suffix ( suffixes n multiplier base -- i/f )
     suffixes length
     [ [ n ] dip multiplier base threshhold < ] find-integer
-   suffixes length or 1 - 0 max ;
+   suffixes length or 1 [-] ;
 
 :: reduce-magnitude ( n multiplier base suffixes -- string )
     n 0 < [