]> gitweb.factorcode.org Git - factor.git/commitdiff
using [ ] [ ... ] ?if instead of [ nip ] [ ... ] if*.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 12 Jul 2016 02:50:37 +0000 (19:50 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 12 Jul 2016 02:50:37 +0000 (19:50 -0700)
20 files changed:
basis/alien/libraries/finder/finder.factor
basis/gobject-introspection/ffi/ffi.factor
basis/ip-parser/ip-parser.factor
basis/json/reader/reader.factor
basis/math/matrices/elimination/elimination.factor
basis/memoize/memoize.factor
basis/ui/gadgets/paragraphs/paragraphs.factor
basis/ui/tools/listener/listener.factor
basis/unix/groups/groups.factor
basis/xml/name/name.factor
extra/benchmark/sha1/sha1.factor
extra/ecdsa/ecdsa.factor
extra/gml/b-rep/b-rep.factor
extra/gpu/shaders/shaders.factor
extra/irc/client/base/base.factor
extra/money/money.factor
extra/rosetta-code/probabilistic-choice/probabilistic-choice.factor
unmaintained/opengl-gadgets/gadgets.factor
unmaintained/semantic-db/semantic-db.factor
unmaintained/tangle/menu/menu.factor

index 268137a2dbb9e6c302e374bee56ee5101185b6da..8c26d23973de66db1794ece71a59034f9cccade2 100644 (file)
@@ -19,6 +19,6 @@ HOOK: find-library* os ( name -- path/f )
 ! or "library_not_found" as a last resort for better debugging.
 : find-library-from-list ( seq -- path/f )
     dup [ find-library* ] map-find drop
-    [ nip ] [ ?first "library_not_found" or ] if* ;
+    [ ] [ ?first "library_not_found" or ] ?if ;
 
 "alien.libraries.finder." os name>> append require
index c501958c9321f07e9a320f0cd1b88ed307e974c1..6e51f8010e99b3c0f09bced46f140fabca638bde 100644 (file)
@@ -304,7 +304,7 @@ M: array-type field-type>c-type type>c-type ;
     [
         [
             dup find-existing-boxed-type
-            [ nip ] [ c-type>> defer-c-type ] if*
+            [ ] [ c-type>> defer-c-type ] ?if
         ]
         [ name>> qualified-name ] bi
         boxed-info new swap register-type
index 45a39282479d94ad7a4bfbd743357b8ec0671dae..d08477d5f9f62baf7e27fe6223ee11ea70a20fdb 100644 (file)
@@ -59,7 +59,7 @@ ERROR: more-than-8-components ;
 <PRIVATE
 
 : ipv6-component ( str -- n )
-    dup hex> [ nip ] [ bad-ipv6-component ] if* ;
+    dup hex> [ ] [ bad-ipv6-component ] ?if ;
 
 : split-ipv6 ( string -- seq )
     ":" split CHAR: . over last member? [ unclip-last ] [ f ] if
index 742d8773f568f54452e83a7d136e672b31db649c..e08e1ae5b4b94c12ddc6075bdc0257c9891b92a2 100644 (file)
@@ -17,7 +17,7 @@ ERROR: not-a-json-number string ;
             { "Infinity" [ 1/0. ] }
             { "-Infinity" [ -1/0. ] }
             { "NaN" [ 0/0. ] }
-            [ dup string>number [ nip ] [ not-a-json-number ] if* ]
+            [ dup string>number [ ] [ not-a-json-number ] ?if ]
         } case
     ] dip ;
 
index 73c46730a22b5e8135f8b6308d70a1c49fca528f..176a140d4f5325c8777d706a8a17b649302253c2 100644 (file)
@@ -21,7 +21,7 @@ SYMBOL: matrix
 : cols ( -- n ) 0 nth-row length ;
 
 : skip ( i seq quot -- n )
-    over [ find-from drop ] dip swap [ nip ] [ length ] if* ; inline
+    over [ find-from drop ] dip swap [ ] [ length ] ?if ; inline
 
 : first-col ( row# -- n )
     ! First non-zero column
index 12732b80900d5431c7b3451753fe552b0cd0749d..bc34c481f302a69e0853a9d8597fdd98c7987d8c 100644 (file)
@@ -46,7 +46,7 @@ IN: memoize
     out>> [
         packer '[
             _ dup first-unsafe
-            [ nip ] [ @ @ [ 0 rot set-nth-unsafe ] keep ] if*
+            [ ] [ @ @ [ 0 rot set-nth-unsafe ] keep ] ?if
         ]
     ] keep unpacker compose ;
 
index 8c1817c9efb51ecb1baf20457636d223bba9c5af..e0ca89f44da93bfd46d749089e155fdf63f74046 100644 (file)
@@ -45,7 +45,7 @@ TUPLE: line words width height baseline ;
 
 : cached-wrapped ( paragraph -- wrapped-paragraph )
     dup wrapped>>
-    [ nip ] [ [ wrap-paragraph dup ] keep wrapped<< ] if* ;
+    [ ] [ [ wrap-paragraph dup ] keep wrapped<< ] ?if ;
 
 : max-line-width ( wrapped-paragraph -- x )
     [ width>> ] [ max ] map-reduce ;
index 31e7325ab13ab7d2d860676b25b37dc8225c9624..ca8b2e94d24915f85215620b39b6deaf8479a97b 100644 (file)
@@ -366,7 +366,7 @@ M: object accept-completion-hook 2drop ;
 M: interactor stream-read-quot ( stream -- quot/f )
     dup interactor-yield dup array? [
         over interactor-finish try-parse
-        [ nip ] [ stream-read-quot ] if*
+        [ ] [ stream-read-quot ] ?if
     ] [ nip ] if ;
 
 : interactor-operation ( gesture interactor -- ? )
index ad285a665e2602e7f324c290ab7ec2066e499c93..b43f8d43acd63c783af4e00a8af8d5a8a487728e 100644 (file)
@@ -51,7 +51,7 @@ PRIVATE>
     ] [
         group-struct [ gr_name>> ] [ f ] if*
     ] if*
-    [ nip ] [ number>string ] if* ;
+    [ ] [ number>string ] ?if ;
 
 : group-id ( string -- id/f )
     group-struct dup [ gr_gid>> ] when ;
index 77685e35b28d00c990dcdc67c69db7562723590c..51b1dcf5ada671c77bfc3ba23a756eec4fab2e69 100644 (file)
@@ -25,7 +25,7 @@ SYMBOL: ns-stack
 
 : add-ns ( name -- )
     dup space>> dup ns-stack get assoc-stack
-    [ nip ] [ nonexist-ns ] if* >>url drop ;
+    [ ] [ nonexist-ns ] ?if >>url drop ;
 
 : push-ns ( hash -- )
     ns-stack get push ;
index 3dd067fea505eb580fa08fe187541da55a0b92d8..50675645e067007f28bf25da16a253b64a95f75c 100644 (file)
@@ -4,4 +4,15 @@ IN: benchmark.sha1
 : sha1-benchmark ( -- )
     2000000 iota >byte-array sha1 checksum-bytes drop ;
 
+: sha224-benchmark ( -- )
+    2000000 iota >byte-array sha-224 checksum-bytes drop ;
+
+: sha256-benchmark ( -- )
+    2000000 iota >byte-array sha-256 checksum-bytes drop ;
+
+USE: checksums.openssl
+
+: openssl-sha1-benchmark ( -- )
+    2000000 iota >byte-array openssl-sha1 checksum-bytes drop ;
+
 MAIN: sha1-benchmark
index 63fda8ab40e7d552b6b8b139b92b9f2cf12ec421..1044fa38939379fd73c2509e27acec86e940b2d4 100644 (file)
@@ -19,7 +19,7 @@ M: ec-key dispose
     EC_KEY_new_by_curve_name dup ssl-error ec-key boa ;
 
 : ec-key-handle ( -- handle )
-    ec-key get dup handle>> [ nip ] [ already-disposed ] if* ;
+    ec-key get dup handle>> [ ] [ already-disposed ] ?if ;
 
 DESTRUCTOR: BN_clear_free
 
index ff514c3ab7334b4e3c8a30aae7435940a002ff76..b946793294008d1cd6b74f66afe7700ab1080357 100644 (file)
@@ -43,7 +43,7 @@ GML: faceCCW ( e0 -- e1 ) face-ccw ;
 
 GML: baseface ( e0 -- e1 ) base-face>> ;
 
-GML: nextring ( e0 -- e1 ) dup next-ring>> [ nip ] [ base-face>> ] if* ;
+GML: nextring ( e0 -- e1 ) dup next-ring>> [ ] [ base-face>> ] ?if ;
 
 GML: facenormal ( e0 -- n ) face-normal ;
 GML: faceplanedist ( e0 -- d ) face-plane-dist ;
index 559f46f5602c6b3dfd718e29b00fa43958a0f74b..8dac18ca70605cb2338b5b9c031f562f2e75b288 100755 (executable)
@@ -310,7 +310,7 @@ SYMBOL: padding-no
     { } <struct-slot-spec> ;
 
 : shader-filename ( shader/program -- filename )
-    dup filename>> [ nip ] [ name>> where first ] if* file-name ;
+    dup filename>> [ ] [ name>> where first ] ?if file-name ;
 
 : numbered-log-line? ( log-line-components -- ? )
     {
index ce343315a298e2b408a5a52108fd17827b972178..2f06fd6cfb503b1201dfe8b53e49b94eed91fa19 100644 (file)
@@ -35,7 +35,7 @@ M: to-me      chat-name sender>> ;
 ! ":flogbot2_!~flogbot2@c-50-174-221-28.hsd1.ca.comcast.net JOIN #concatenative-bots"
 ! The channel>> field is empty and it's in parameters instead.
 ! This fixes chat> for these kinds of messages.
-M: to-channel chat-name dup channel>> [ nip ] [ parameters>> ?first ] if* ;
+M: to-channel chat-name dup channel>> [ ] [ parameters>> ?first ] ?if ;
 
 GENERIC: chat> ( obj -- chat/f )
 M: string      chat> irc> chats>> at ;
index a0ac13246d485292298b8ffcaaad0c0e6ac2941e..3e352c88284ee7e3aae0f54f55d0523c88c3c11f 100644 (file)
@@ -28,7 +28,7 @@ ERROR: not-an-integer x ;
 : parse-decimal ( str -- ratio )
     split-decimal [ [ "0" ] when-empty ] bi@
     [
-        [ dup string>number [ nip ] [ not-an-integer ] if* ] bi@
+        [ dup string>number [ ] [ not-an-integer ] ?if ] bi@
     ] keep length 10^ / + swap [ neg ] when ;
 
 SYNTAX: DECIMAL: scan-token parse-decimal suffix! ;
index f62c44d9737b297b1329645fede488c9ee851be3..de7b176ab970d1a8418148ded41b2f5c2a298f2a 100644 (file)
@@ -41,7 +41,7 @@ MACRO: case-probas ( data -- quot )
     [ first2 [ 1quotation ] dip [ swap 2array ] when* ] map 1quotation ;
 
 : expected ( data name -- float )
-    dupd of [ nip ] [ values sift sum 1 swap - ] if* ;
+    dupd of [ ] [ values sift sum 1 swap - ] ?if ;
 
 : generate ( # case-probas -- seq )
     H{ } clone [
index b24783e4ef68e2537f30e3ac709c2a50e51a2267..70d7758a7bf42c534d0465be80819c3a7c55b616 100644 (file)
@@ -34,7 +34,7 @@ C: <entry> cache-entry
 
 : get-entry ( gadget -- {texture,dims} )
     dup cache-key* textures get at
-    [ nip ] [ make-entry ] if* ;
+    [ ] [ make-entry ] ?if ;
 
 : get-dims ( gadget -- dims )
     get-entry dims>> ;
index c4bb7728a34178d572650c29ee76342359da5af8..f2bf9ad4b55a8dd0477a293a97c55e1d1493fb2a 100644 (file)
@@ -20,7 +20,7 @@ node "node"
 : load-node ( id -- node ) f <node> select-tuple ;
 
 : node-content ( node -- content )
-    dup content>> [ nip ] [ select-tuple content>> ] if* ;
+    dup content>> [ ] [ select-tuple content>> ] ?if ;
 
 : node= ( node node -- ? ) [ id>> ] same? ;
 
index 9740acee1c24c39f7608cfefab057cbce095b30c..828db5dfc3904411d05e21bea583f158530f2d63 100644 (file)
@@ -13,7 +13,7 @@ RELATION: before
     get-menus [ node-content = ] with find nip ;
 
 : ensure-menu ( name -- node )
-    dup get-menu [ nip ] [ create-node ] if* ;
+    dup get-menu [ ] [ create-node ] ?if ;
 
 : load-menu ( name -- menu )
     get-menu subitem-of-relation get-node-tree-s ;