]> gitweb.factorcode.org Git - factor.git/commitdiff
using [ ... ] [ drop ] if* instead of dup [ ... ] [ 2drop ] if.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 12 Jul 2016 04:01:03 +0000 (21:01 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 12 Jul 2016 04:01:03 +0000 (21:01 -0700)
basis/ui/baseline-alignment/baseline-alignment.factor
basis/ui/clipboards/clipboards.factor
basis/ui/gadgets/tables/tables.factor
basis/ui/render/render.factor
basis/ui/tools/browser/history/history.factor
core/io/encodings/utf16/utf16.factor
core/sbufs/sbufs-tests.factor
extra/forestdb/paths/paths.factor
extra/graphviz/dot/dot.factor
extra/project-euler/265/265.factor

index 27330d798a41fdc142fd4432135402caa79381c1..37fcbf1c63e4c37e7a94f81b33f06ef8d824f1f1 100644 (file)
@@ -98,4 +98,4 @@ PRIVATE>
     (measure-metrics) combine-metrics ;
 
 : measure-height ( children sizes -- height )
-    (measure-metrics) dup [ combine-metrics + ] [ 3drop ] if ;
+    (measure-metrics) [ combine-metrics + ] [ 2drop ] if* ;
index ec7bb5993151b62a1117f152b4d617a0ceccbd8b..52998fefe286f079463b1aa11bed6a2ed1eccc3b 100644 (file)
@@ -22,7 +22,7 @@ M: clipboard set-clipboard-contents contents<< ;
 GENERIC: paste-clipboard ( gadget clipboard -- )
 
 M: object paste-clipboard
-    clipboard-contents dup [ swap user-input ] [ 2drop ] if ;
+    clipboard-contents [ swap user-input ] [ drop ] if* ;
 
 GENERIC: copy-clipboard ( string gadget clipboard -- )
 
index 88f1e8476e0b7b7e4c63e9813c11cd99a3ceb640..f4015a2104dcb95e9ac5b9358e483e860771465c 100644 (file)
@@ -299,7 +299,7 @@ M: table model-changed
     row-rect [ { 0 1 } v* ] change-dim ;
 
 : scroll-to-row ( table n -- )
-    dup [ [ thin-row-rect ] [ drop ] 2bi scroll>rect ] [ 2drop ] if ;
+    [ [ thin-row-rect ] [ drop ] 2bi scroll>rect ] [ drop ] if* ;
 
 : (select-row) ( table n -- )
     [ scroll-to-row ]
index f28be2a2ac653dbba1b8b164220a52d906e84f68..33c1f812bbea3d831961748a95bf6baa43a39b55 100644 (file)
@@ -92,7 +92,7 @@ M: gadget gadget-foreground dup interior>> pen-foreground ;
     [ { 0 0 } ] dip dim>> gl-fill-rect ;
 
 : draw-standard-background ( object -- )
-    dup interior>> dup [ draw-interior ] [ 2drop ] if ;
+    dup interior>> [ draw-interior ] [ drop ] if* ;
 
 : draw-background ( gadget -- )
     origin get [
index f8fcf09b2e9cf2ca8176b99447c99755d8f5228d..8b0aec8a9b4c7b4a6033d19bfe4e7ac99d5123ef 100644 (file)
@@ -13,7 +13,7 @@ GENERIC: history-value ( object -- value )
 GENERIC: set-history-value ( value object -- )
 
 : (add-history) ( history to -- )
-    swap owner>> history-value dup [ swap push ] [ 2drop ] if ;
+    swap owner>> history-value [ swap push ] [ drop ] if* ;
 
 :: go-back/forward ( history to from -- )
     from empty? [
index 5eba481bd38e2671a1304cc6484d7468123e8eeb..2e1b2f560546942284c3151fced92f089efba790 100644 (file)
@@ -61,7 +61,7 @@ M: utf16be decode-char
     ] [ append-nums ] if ;
 
 : begin-utf16le ( stream byte -- stream char )
-    over stream-read1 dup [ double-le ] [ 2drop replacement-char ] if ;
+    over stream-read1 [ double-le ] [ drop replacement-char ] if* ;
 
 M: utf16le decode-char
     drop dup stream-read1 dup [ begin-utf16le ] when nip ;
index 06212ddb0c3586b9ecf1dfa25c758ac1c9b5584e..1f827ea23624af02c7a5dfb831dfbc861ebe6664 100644 (file)
@@ -16,7 +16,7 @@ sequences.private strings tools.test ;
     CHAR: H 0 SBUF" hello world" [ set-nth ] keep first
 ] unit-test
 
-{ SBUF" x" } [ 1 <sbuf> CHAR: x >bignum over push ] unit-test
+{ SBUF" x" } [ 1 <sbuf> CHAR: x >bignum suffix! ] unit-test
 
 { fixnum } [ 1 >bignum SBUF" " new-sequence length class-of ] unit-test
 
index 9ba158673d1b8f4fa3ce65ab11603aededf91bc4..5eb335290d8bd56b0d478c777c23a9eafba96f10 100644 (file)
@@ -23,7 +23,7 @@ ERROR: not-an-fdb-filename string ;
 ERROR: not-a-string-number string ;
 
 : ?string>number ( string -- n )
-    dup string>number dup [ nip ] [ not-a-string-number ] if ;
+    dup string>number [ ] [ not-a-string-number ] ?if ;
 
 : change-string-number ( string quot -- string' )
     [ [ string>number ] dip call number>string ] 2keep drop
index 48677794b88b35a4a8a2d728ecefb642db7b870d..1630b84fbeda60347c256532a65e24e4c9c7ea1a 100644 (file)
@@ -50,7 +50,7 @@ M: subgraph dot.
     "subgraph " write [ id. ] [ statements. ] bi ;
 
 : attribute, ( attr value -- )
-    dup [ quote-string "%s=%s," printf ] [ 2drop ] if ;
+    [ quote-string "%s=%s," printf ] [ drop ] if* ;
 
 : attributes. ( attrs -- )
     "[" write
index 261a9e8ff20b5167c33039d9990da895a8c706a9..387677fef6eff647ec2043d8f9bcd0e57b190d64 100644 (file)
@@ -41,7 +41,7 @@ CONSTANT: N 5
 
 : ?register ( acc seq -- )
     complete rotate-bits
-    dup [ 2 N ^ mod ] map all-unique? [ infimum swap push ] [ 2drop ] if ;
+    [ 2 N ^ mod ] map all-unique? [ infimum swap push ] [ drop ] if* ;
 
 : add-bit ( seen bit -- seen' t/f )
     over last 2 * + 2 N ^ mod