]> gitweb.factorcode.org Git - factor.git/commitdiff
factor: use ??if instead of ?if-old
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 14 Feb 2023 05:29:34 +0000 (23:29 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 26 Feb 2023 23:11:04 +0000 (17:11 -0600)
71 files changed:
basis/alien/c-types/c-types.factor
basis/alien/libraries/finder/finder.factor
basis/alien/libraries/finder/macosx/macosx.factor
basis/bootstrap/image/image.factor
basis/checksums/openssl/openssl.factor
basis/classes/struct/struct.factor
basis/cocoa/messages/messages.factor
basis/cocoa/pasteboard/pasteboard.factor
basis/cocoa/subclassing/subclassing.factor
basis/colors/colors.factor
basis/compiler/cfg/intrinsics/misc/misc.factor
basis/compiler/cfg/linearization/linearization.factor
basis/compiler/cfg/rpo/rpo.factor
basis/compiler/cfg/stacks/local/local.factor
basis/compiler/cfg/value-numbering/value-numbering.factor
basis/compiler/tree/debugger/debugger.factor
basis/compiler/tree/tuple-unboxing/tuple-unboxing.factor
basis/concurrency/distributed/distributed.factor
basis/concurrency/messaging/messaging.factor
basis/core-foundation/bundles/bundles.factor
basis/db/types/types.factor
basis/editors/editors.factor
basis/fixups/fixups.factor
basis/furnace/asides/asides.factor
basis/furnace/auth/providers/couchdb/couchdb.factor
basis/gobject-introspection/types/types.factor
basis/help/help.factor
basis/html/templates/chloe/chloe.factor
basis/html/templates/chloe/compiler/compiler.factor
basis/ui/baseline-alignment/baseline-alignment.factor
basis/ui/commands/commands.factor
basis/ui/gadgets/gadgets.factor
basis/ui/gadgets/line-support/line-support.factor
basis/ui/gadgets/paragraphs/paragraphs.factor
basis/ui/gadgets/tables/tables.factor
basis/ui/gestures/gestures.factor
basis/ui/operations/operations.factor
basis/ui/theme/base16/base16.factor
basis/unix/groups/groups.factor
basis/urls/urls.factor
basis/validators/validators.factor
basis/vocabs/metadata/metadata.factor
basis/vocabs/refresh/refresh.factor
basis/xml/autoencoding/autoencoding.factor
basis/xml/entities/entities.factor
basis/xml/name/name.factor
core/syntax/syntax.factor
core/vocabs/loader/loader.factor
core/vocabs/vocabs.factor
core/words/words.factor
extra/24-game/24-game.factor
extra/combinators/extras/extras-tests.factor
extra/combinators/extras/extras.factor
extra/compiler/cfg/gvn/gvn.factor
extra/crontab/crontab.factor
extra/ecdsa/ecdsa.factor
extra/gml/b-rep/b-rep.factor
extra/gpu/shaders/shaders.factor
extra/help/lint/coverage/coverage.factor
extra/images/viewer/viewer.factor
extra/infix/infix.factor
extra/irc/client/base/base.factor
extra/money/money.factor
extra/sequences/extras/extras.factor
extra/site-watcher/db/db.factor
extra/smalltalk/compiler/compiler.factor
extra/smalltalk/parser/parser.factor
extra/usa-cities/usa-cities.factor
extra/webapps/mason/status-update/status-update.factor
extra/webapps/wee-url/wee-url.factor
extra/webapps/wiki/wiki.factor

index c2836870decfd5ccb302e8b1b85f03e1c34d5b13..8d645132b2f0d57f687a335b60faa78215645b9a 100644 (file)
@@ -54,12 +54,12 @@ UNION: c-type-name
     c-type-word pointer ;
 
 : resolve-typedef ( name -- c-type )
-    dup void? [ no-c-type ] when
+    [ void? ] [ no-c-type ] ?when
     dup c-type-name? [ lookup-c-type ] when ;
 
 M: word lookup-c-type
-    dup "c-type" word-prop resolve-typedef
-    [ ] [ no-c-type ] ?if ;
+    [ "c-type" word-prop resolve-typedef ]
+    [ no-c-type ] ?unless ;
 
 GENERIC: c-type-class ( name -- class )
 
index 8c26d23973de66db1794ece71a59034f9cccade2..876880608d323f5a2370446d2d0ab47533288779 100644 (file)
@@ -18,7 +18,7 @@ HOOK: find-library* os ( name -- path/f )
 ! try to open a library that is the first name in that list anyway
 ! or "library_not_found" as a last resort for better debugging.
 : find-library-from-list ( seq -- path/f )
-    dup [ find-library* ] map-find drop
-    [ ] [ ?first "library_not_found" or ] ?if ;
+    [ [ find-library* ] map-find drop ]
+    [ ?first "library_not_found" or ] ?unless ;
 
 "alien.libraries.finder." os name>> append require
index 21cfc3428b6e5e60084f25fad52d0587d0bb8b47..2b6ba65f9a5d0692ecdd23201464d809549d8a79 100644 (file)
@@ -126,7 +126,7 @@ PRIVATE>
             { [ use-dyld-shared-cache? ] [ _dyld_shared_cache_contains_path ] }
             [ drop f ]
         } cond
-    ] find [ nip ] when* ;
+    ] find nip ;
 
 : framework-find ( name -- path )
     dup dyld-find [ nip ] [
index b05b77c821eacfa1bf36a24093c691f6a4d44497..9730593457c5504baec2f8dda0c335497b33fb69 100644 (file)
@@ -288,8 +288,8 @@ ERROR: not-in-image vocabulary word ;
     [ target-word ] keep or ;
 
 : fixup-word ( word -- offset )
-    transfer-word dup lookup-object
-    [ ] [ [ vocabulary>> ] [ name>> ] bi not-in-image ] ?if ;
+    transfer-word
+    [ lookup-object ] [ [ vocabulary>> ] [ name>> ] bi not-in-image ] ?unless ;
 
 : fixup-words ( -- )
     bootstrapping-image get [ dup word? [ fixup-word ] when ] map! drop ;
@@ -361,7 +361,7 @@ M: byte-array prepare-object
 ERROR: tuple-removed class ;
 
 : require-tuple-layout ( word -- layout )
-    dup tuple-layout [ ] [ tuple-removed ] ?if ;
+    [ tuple-layout ] [ tuple-removed ] ?unless ;
 
 : (emit-tuple) ( tuple -- pointer )
     [ tuple-slots ]
index ba40386a79f590d9ad2e7f0571d8bccf30f26496..421d9fc4a1a8f22a4795dc8f310ab294e151a016 100644 (file)
@@ -33,7 +33,7 @@ M: evp-md-context dispose*
     handle>> evp-md-ctx-free ;
 
 : digest-named ( name -- md )
-    dup EVP_get_digestbyname [ ] [ unknown-digest ] ?if ;
+    [ EVP_get_digestbyname ] [ unknown-digest ] ?unless ;
 
 : set-digest ( name ctx -- )
     handle>> swap digest-named f EVP_DigestInit_ex ssl-error ;
index 253c6234fe446b8116669cd9e272c900a2bfae29..300f4fd69e108e32bec58e8f5b7e9be5d6d3ee02 100644 (file)
@@ -65,7 +65,7 @@ M: struct >c-ptr
 <PRIVATE
 
 : init-struct ( class with-prototype: ( prototype -- alien ) sans-prototype: ( class -- alien ) -- alien )
-    '[ dup struct-prototype _ _ ?if ] keep memory>struct ; inline
+    '[ [ struct-prototype ] _ _ ??if ] keep memory>struct ; inline
 
 PRIVATE>
 
index 3960701e36f7a380dbaf2dbea9ef977821700a36..5bb5277a0d451a3020a3db49d5b5769331904509 100644 (file)
@@ -71,7 +71,7 @@ ERROR: no-objc-method name ;
     objc-methods get at ;
 
 : lookup-objc-method ( name -- signature )
-    dup ?lookup-objc-method [ ] [ no-objc-method ] ?if ;
+    [ ?lookup-objc-method ] [ no-objc-method ] ?unless ;
 
 MEMO: make-prepare-send ( selector signature super? -- quot )
     [
@@ -194,8 +194,8 @@ assoc-union alien>objc-types set-global
 ERROR: no-objc-type name ;
 
 : decode-type ( ch -- ctype )
-    1string dup objc>alien-types get at
-    [ ] [ no-objc-type ] ?if ;
+    1string
+    [ objc>alien-types get at ] [ no-objc-type ] ?unless ;
 
 : (parse-objc-type) ( i string -- ctype )
     [ [ 1 + ] dip ] [ nth ] 2bi {
@@ -289,7 +289,7 @@ ERROR: no-objc-type name ;
     ] [ drop ] if ;
 
 : root-class ( class -- root )
-    dup class_getSuperclass [ root-class ] [ ] ?if ;
+    [ class_getSuperclass ] [ root-class ] ?when ;
 
 : objc-class-names ( -- seq )
     [
index 06ba2442c6cc0ec00c7fb5e3949a8a96411de6cc..c4e54c2266d61c68da3f614a91335f673633d65d 100644 (file)
@@ -12,7 +12,7 @@ CONSTANT: NSStringPboardType "NSStringPboardType"
 
 : pasteboard-string ( pasteboard -- str )
     NSStringPboardType <NSString> -> stringForType:
-    dup [ CF>string ] when ;
+    [ CF>string ] transmute ;
 
 : set-pasteboard-types ( seq pasteboard -- )
     swap <CFArray> -> autorelease f -> declareTypes:owner: drop ;
index 3e66b31e470c09a06bfa036d56da3a1d5cb9c409..5fd1ff86f2150a35ab743ff49a8d708f1169dbfe 100644 (file)
@@ -33,7 +33,7 @@ IN: cocoa.subclassing
     tri ;
 
 : encode-type ( type -- encoded )
-    dup alien>objc-types get at [ ] [ no-objc-type ] ?if ;
+    [ alien>objc-types get at ] [ no-objc-type ] ?unless ;
 
 : encode-types ( return types -- encoding )
     swap prefix [ encode-type "0" append ] map concat ;
index d1fc3e5bf79144cdd54680b2d52a043ce9c04515..e31f228779c011a224533517821414378b2bc991 100644 (file)
@@ -91,7 +91,7 @@ PRIVATE>
 ERROR: no-such-color name ;
 
 : named-color ( name -- color )
-    dup colors at [ ] [ no-such-color ] ?if ;
+    [ colors at ] [ no-such-color ] ?unless ;
 
 : parse-color ( str -- color )
     "#" ?head [ hex>rgba ] [ named-color ] if ;
index b32f6c2c6f5a1585fcd30fbaabf39149e65b9510..76603d5bfbbfcf967b41786fdee1a06b56b8f343 100644 (file)
@@ -15,26 +15,26 @@ IN: compiler.cfg.intrinsics.misc
     [ [ cc= ^^compare-integer ] binary-op ] [ [ cc= ^^compare ] binary-op ] if ;
 
 : emit-special-object ( block node -- block' )
-    dup node-input-infos first literal>> [
+    [ node-input-infos first literal>> ] [
         ds-drop
         vm-special-object-offset ^^vm-field
         ds-push
-    ] [ emit-primitive ] ?if ;
+    ] [ emit-primitive ] ??if ;
 
 : emit-set-special-object ( block node -- block' )
-    dup node-input-infos second literal>> [
+    [ node-input-infos second literal>> ] [
         ds-drop
         [ ds-pop ] dip vm-special-object-offset ##set-vm-field,
-    ] [ emit-primitive ] ?if ;
+    ] [ emit-primitive ] ??if ;
 
 : context-object-offset ( n -- n )
     cells "context-objects" context offset-of + ;
 
 : emit-context-object ( block node -- block' )
-    dup node-input-infos first literal>> [
+    [ node-input-infos first literal>> ] [
         "ctx" vm offset-of ^^vm-field
         ds-drop swap context-object-offset cell /i 0 ^^slot-imm ds-push
-    ] [ emit-primitive ] ?if ;
+    ] [ emit-primitive ] ??if ;
 
 : emit-identity-hashcode ( -- )
     [
index 850ef1f562344d7963139b06252aeec8eaef8dba..529e505a6f3fa7237906f1b29d2da2934ee35b4d 100644 (file)
@@ -59,10 +59,10 @@ PRIVATE>
         [ needs-loops ]
         [ needs-predecessors ]
         [
-            dup linear-order>> [ ] [
+            [ linear-order>> ] [
                 dup (linearization-order)
                 >>linear-order linear-order>>
-            ] ?if
+            ] ?unless
         ]
     } cleave ;
 
index 0ecbc510ae5d9732fcb890e09a1dcf949a42dab7..692c01114e7a6ce8429b0c04357700734292f7cf 100644 (file)
@@ -17,13 +17,13 @@ IN: compiler.cfg.rpo
     [ >>number drop ] 2each ;
 
 : post-order ( cfg -- blocks )
-    dup post-order>> [ ] [
+    [ post-order>> ] [
         [
             HS{ } clone over entry>>
             post-order-traversal drop
         ] { } make dup number-blocks
         >>post-order post-order>>
-    ] ?if ;
+    ] ?unless ;
 
 : reverse-post-order ( cfg -- blocks )
     post-order <reversed> ; inline
index aefc7585ced8b26264e71161b340536366d416a5..52efd7d9c34279f82810d982772f643ba8543e10 100644 (file)
@@ -52,8 +52,8 @@ SYMBOLS: locs>vregs local-peek-set replaces ;
 
 : peek-loc ( loc -- vreg )
     height-state get global-loc>local
-    dup replaces get at
-    [ ] [ dup local-peek-set get adjoin loc>vreg ] ?if ;
+    [ replaces get at ]
+    [ dup local-peek-set get adjoin loc>vreg ] ?unless ;
 
 : replace-loc ( vreg loc -- )
     height-state get global-loc>local replaces get set-at ;
index cb48285f1f0fab80318dbe0df26bf1553670e98e..168024412b6e9279258f48884860caa46e99c53e 100644 (file)
@@ -30,16 +30,17 @@ GENERIC: process-instruction ( insn -- insn' )
     insn ;
 
 : check-redundancy ( insn -- insn' )
-    dup >expr dup exprs>vns get at
-    [ redundant-instruction ] [ useful-instruction ] ?if ;
+    dup >expr
+    [ exprs>vns get at ]
+    [ redundant-instruction ] [ useful-instruction ] ??if ;
 
 M: insn process-instruction
-    dup rewrite [ process-instruction ] [ ] ?if ;
+    [ rewrite ] [ process-instruction ] ?when ;
 
 M: foldable-insn process-instruction
-    dup rewrite
+    [ rewrite ]
     [ process-instruction ]
-    [ dup defs-vregs length 1 = [ check-redundancy ] when ] ?if ;
+    [ dup defs-vregs length 1 = [ check-redundancy ] when ] ??if ;
 
 M: ##copy process-instruction
     dup [ src>> vreg>vn ] [ dst>> ] bi set-vn ;
index ab1b267547c0ee01714a4b1fedb45967d61b01a1..a49485999127170bca012aaba643fa0017e1b262 100644 (file)
@@ -84,8 +84,8 @@ M: #shuffle node>quot
         {
             [ dup { [ in-r>> empty? ] [ out-r>> empty? ] } 1&& ]
             [
-                shuffle-effect dup pretty-shuffle
-                [ % ] [ shuffle-node boa , ] ?if
+                shuffle-effect
+                [ pretty-shuffle ] [ % ] [ shuffle-node boa , ] ??if
             ]
         }
         [ drop "COMPLEX SHUFFLE" , ]
index 8922ea8755f886883f76a66146b9dedddfe209d7..217dd9a3da892830228055f2b31dbb4548bd4d2e 100644 (file)
@@ -33,8 +33,8 @@ M: #push unbox-tuples* ( #push -- nodes )
 
 : (flatten-values) ( values accum -- )
     dup '[
-        dup unboxed-allocation
-        [ _ (flatten-values) ] [ _ push ] ?if
+        [ unboxed-allocation ]
+        [ _ (flatten-values) ] [ _ push ] ??if
     ] each ;
 
 : flatten-values ( values -- values' )
index 9f4470b44d3e52175afc09c50dcb125cf8da032b..87ea1b9dea4cce32c7d9fb85a4e28ec560a7cc1d 100644 (file)
@@ -24,7 +24,7 @@ PRIVATE>
     registered-remote-threads delete-at ;
 
 : get-remote-thread ( name -- thread )
-    dup registered-remote-threads at [ ] [ threads at ] ?if ;
+    [ registered-remote-threads at ] [ threads at ] ?unless ;
 
 SYMBOL: local-node
 
index 50784ef4b143ebf52447dd193c8bc1e70ea7ce71..78aa6e003f6732dd3c8ece5d68e00f2625c98650 100644 (file)
@@ -9,9 +9,9 @@ GENERIC: send ( message thread -- )
 GENERIC: mailbox-of ( thread -- mailbox )
 
 M: thread mailbox-of
-    dup mailbox>>
+    [ mailbox>> ]
     [ { mailbox } declare ]
-    [ <mailbox> [ >>mailbox drop ] keep ] ?if ; inline
+    [ <mailbox> [ >>mailbox drop ] keep ] ??if ; inline
 
 M: thread send
     mailbox-of mailbox-put ;
index f75b5a82c3e2e6105d59813ced1f3c0cd7d910f7..24b54f9752c519342aacd0c6d202995c0face7ae 100644 (file)
@@ -16,8 +16,6 @@ FUNCTION: Boolean CFBundleLoadExecutable ( CFBundleRef bundle )
     ] keep CFRelease ;
 
 : load-framework ( name -- )
-    dup <CFBundle> [
-        CFBundleLoadExecutable drop
-    ] [
-        "Cannot load bundle named " prepend throw
-    ] ?if ;
+    [ <CFBundle> ]
+    [ CFBundleLoadExecutable drop ]
+    [ "Cannot load bundle named " prepend throw ] ??if ;
index 6405959396cd2dce5e4e77bfbb90397930a17c61..bec97983c714710b196170b2b32b99ad1e1f0364 100644 (file)
@@ -35,7 +35,7 @@ SYMBOL: IGNORE
 ERROR: not-persistent class ;
 
 : db-table-name ( class -- object )
-    dup "db-table" word-prop [ ] [ not-persistent ] ?if ;
+    [ "db-table" word-prop ] [ not-persistent ] ?unless ;
 
 : db-columns ( class -- object )
     superclasses-of [ "db-columns" word-prop ] map concat ;
index 9f1fd45856dd30b66c11ca123fcac23c82b6dff7..72a3ae758ecf621dbfc11e5c4ed169a2d2582ce1 100644 (file)
@@ -104,7 +104,7 @@ PRIVATE>
 GENERIC: edit ( object -- )
 
 M: object edit
-    dup where [ first2 edit-location ] [ cannot-find-source ] ?if ;
+    [ where ] [ first2 edit-location ] [ cannot-find-source ] ??if ;
 
 M: string edit edit-vocab ;
 
index 1b74e8aea58200b2c1e6afe900ee8e1b4cf81f7e..9c47f8708bd3891a2d9e12edbcf74bfea0d8ac29 100644 (file)
@@ -62,6 +62,7 @@ CONSTANT: word-renames {
     { "random-integers" { "randoms" "0.99" } }
     { "count*" { "percent-of" "0.99" } }
     { "more?" { "deref?" "0.99" } }
+    { "plox" { "?transmute" "0.99" } }
 }
 
 : compute-assoc-fixups ( continuation name assoc -- seq )
index 15f182d342d885dddef047f706e898440ac4c159..caec27c0d0f93a3f54586ba2c120e6d4b0668953 100644 (file)
@@ -81,7 +81,8 @@ ERROR: end-aside-in-get-error ;
     } case ;
 
 : end-aside ( default -- response )
-    aside-id get aside-id off get-aside [ move-on ] [ <redirect> ] ?if ;
+    [ drop aside-id get aside-id off get-aside ]
+    [ move-on ] [ <redirect> ] ??if ;
 
 M: asides link-attr
     drop
index 3b090ee64ce38da41774c2cde3aaac807ba5ae29..ca241d161b5ea99f5c2586d462d089121f576e5f 100644 (file)
@@ -115,9 +115,9 @@ TUPLE: couchdb-auth-provider
     [ drop first CHAR: _ = ] assoc-reject ;
 
 : at-or-k ( key hash -- newkey )
-    dupd at [ nip ] when* ;
+    ?at drop ;
 : value-at-or-k ( key hash -- newkey )
-    dupd value-at [ nip ] when* ;
+    ?value-at drop ;
 
 : map-fields-forward ( assoc field-map -- assoc )
     [ swapd at-or-k swap ] curry assoc-map ;
index aa0e9f50b0e5e9f8dc725a741216b5259dae5319..67be2149866f24ff059bdafff345e23bddd351dc 100644 (file)
@@ -78,8 +78,9 @@ PREDICATE: fixed-size-array-type < c-array-type fixed-size>> >boolean ;
 ERROR: unknown-type-error type ;
 
 : get-type-info ( data-type -- info )
-    qualified-type-name dup type-infos get-global at
-    [ ] [ unknown-type-error ] ?if ;
+    qualified-type-name
+    [ type-infos get-global at ]
+    [ unknown-type-error ] ?unless ;
 
 : find-type-info ( data-type -- info/f )
     qualified-type-name type-infos get-global at ;
index 0ab8a74765a91214afcd96307657c28a5c03fcca..21809ec16f9bab83deee8304d1bcd4e6f2f492aa 100644 (file)
@@ -33,7 +33,7 @@ GENERIC: word-help* ( word -- content )
 PRIVATE>
 
 : word-help ( word -- content )
-    [ dup "help" word-prop [ ] [ word-help* ] ?if ] keep
+    [ [ "help" word-prop ] [ word-help* ] ?unless ] keep
     inputs-and-outputs fix-shuffle drop ;
 
 : effect-help ( effect -- content )
index 427db2e14be5f434b051e286d7c224106a0314f7..0cffd9cc1ae2155ece4bd0d7fd82e55bfcd44e9d 100644 (file)
@@ -25,11 +25,9 @@ CHLOE: write-title
     [xml-code] ;
 
 CHLOE: style
-    dup "include" optional-attr [
-        utf8 file-contents [ add-style ] [code-with]
-    ] [
-        compile-children>string [ add-style ] [code]
-    ] ?if ;
+    [ "include" optional-attr ]
+    [ utf8 file-contents [ add-style ] [code-with] ]
+    [ compile-children>string [ add-style ] [code] ] ??if ;
 
 CHLOE: write-style
     drop [
@@ -38,11 +36,9 @@ CHLOE: write-style
     ] [xml-code] ;
 
 CHLOE: script
-    dup "include" optional-attr [
-        utf8 file-contents [ add-script ] [code-with]
-    ] [
-        compile-children>string [ add-script ] [code]
-    ] ?if ;
+    [ "include" optional-attr ]
+    [ utf8 file-contents [ add-script ] [code-with] ]
+    [ compile-children>string [ add-script ] [code] ] ??if ;
 
 CHLOE: write-script
     drop [
@@ -136,10 +132,10 @@ TUPLE: cached-template-state path last-modified quot ;
     ] when ;
 
 : template-quot ( chloe -- quot )
-    dup cached-template [ ] [
+    [ cached-template ] [
         [ load-template dup ] keep
         template-cache get set-at
-    ] ?if quot>> ;
+    ] ?unless quot>> ;
 
 : reset-cache ( -- )
     template-cache get clear-assoc ;
index 95f6bebbcf3bda3d9140885a97caf1ac1d71f170..5a1a9f49cabb8a412d465b765d741abfe29e720a 100644 (file)
@@ -117,10 +117,11 @@ CONSTANT: self-closing-tags {
 ERROR: unknown-chloe-tag tag ;
 
 : compile-chloe-tag ( tag -- )
-    dup main>> dup chloe-tags get at
+    dup main>>
+    [ chloe-tags get at ]
     [ call( tag -- ) ]
     [ unknown-chloe-tag ]
-    ?if ;
+    ??if ;
 
 : compile-string ( string -- )
     string-context? get [ escape-string ] unless [write] ;
index f16424d06f23f3aeb3ac13077656b27d1249d8d8..dae432019f42c665a88f44eccf50ad23cef01417 100644 (file)
@@ -15,11 +15,10 @@ GENERIC: baseline ( gadget -- y )
 M: gadget baseline drop f ;
 
 M: aligned-gadget baseline
-    dup baseline>>
-    [ ] [
+    [ baseline>> ] [
         [ baseline* ] [ ] [ layout-state>> ] tri
         [ drop ] [ dupd baseline<< ] if
-    ] ?if ;
+    ] ?unless ;
 
 GENERIC: cap-height* ( gadget -- y )
 
@@ -28,11 +27,10 @@ GENERIC: cap-height ( gadget -- y )
 M: gadget cap-height drop f ;
 
 M: aligned-gadget cap-height
-    dup cap-height>>
-    [ ] [
+    [ cap-height>> ] [
         [ cap-height* ] [ ] [ layout-state>> ] tri
         [ drop ] [ dupd cap-height<< ] if
-    ] ?if ;
+    ] ?unless ;
 
 <PRIVATE
 
index 6703c91d01fe1b8b08991b8e5ff0aa74a6bdc512..0f9c672ec688e190fcd3e20391ecff0615d12746 100644 (file)
@@ -24,9 +24,9 @@ GENERIC: command-word ( command -- word )
     { } like command-map boa ;
 
 : commands ( class -- hash )
-    dup "commands" word-prop [ ] [
+    [ "commands" word-prop ] [
         H{ } clone [ "commands" set-word-prop ] keep
-    ] ?if ;
+    ] ?unless ;
 
 TR: convert-command-name "-" " " ;
 
index 6f004177ca5faf02c7d71e8230b1ca7b726bd809..5c549ad252a3a4d4727a3bfe029c436843bef699 100644 (file)
@@ -189,10 +189,10 @@ M: gadget dim<<
 GENERIC: pref-dim* ( gadget -- dim )
 
 : pref-dim ( gadget -- dim )
-    dup pref-dim>> [ ] [
+    [ pref-dim>> ] [
         [ pref-dim* ] [ ] [ layout-state>> ] tri
         [ drop ] [ dupd pref-dim<< ] if
-    ] ?if ;
+    ] ?unless ;
 
 : pref-dims ( gadgets -- seq ) [ pref-dim ] map ; inline
 
index 02fa44487cc490032b7cab56d7fa3de6071c01a6..38e6f7df1951c0e66c9cbac8a5e0c8d42653e7b5 100644 (file)
@@ -25,11 +25,11 @@ M: line-gadget line-leading*
 GENERIC: line-leading ( gadget -- n )
 
 M: line-gadget line-leading
-    dup line-leading>>
-    [ ] [
+    [ line-leading>> ]
+    [
         [ line-leading* ] [ ] [ layout-state>> ] tri
         [ drop ] [ dupd line-leading<< ] if
-    ] ?if ;
+    ] ?unless ;
 
 GENERIC: line-height* ( gadget -- n )
 
@@ -39,11 +39,11 @@ M: line-gadget line-height*
 GENERIC: line-height ( gadget -- n )
 
 M: line-gadget line-height
-    dup line-height>>
-    [ ] [
+    [ line-height>> ]
+    [
         [ line-height* ] [ ] [ layout-state>> ] tri
         [ drop ] [ dupd line-height<< ] if
-    ] ?if ;
+    ] ?unless ;
 
 : y>line ( y gadget -- n ) line-height /i ;
 
@@ -107,11 +107,11 @@ PRIVATE>
     [ pref-dim ] [ line-gadget-dim ] bi ;
 
 M: line-gadget pref-viewport-dim
-    dup pref-viewport-dim>>
-    [ ] [
+    [ pref-viewport-dim>> ]
+    [
         [ pref-viewport-dim* ] [ ] [ layout-state>> ] tri
         [ drop ] [ dupd pref-viewport-dim<< ] if
-    ] ?if ;
+    ] ?unless ;
 
 M: line-gadget pref-dim* { 0 0 } swap line-gadget-dim ;
 
index e4085b2d2fe891cc3a3d5590227f5736b5ec40af..d4a3a8ccab29106124fb52c6014a7aef03430fb8 100644 (file)
@@ -44,8 +44,8 @@ TUPLE: line words width height baseline ;
     wrap-words [ <line> ] map! ;
 
 : cached-wrapped ( paragraph -- wrapped-paragraph )
-    dup wrapped>>
-    [ ] [ [ wrap-paragraph dup ] keep wrapped<< ] ?if ;
+    [ wrapped>> ]
+    [ [ wrap-paragraph dup ] keep wrapped<< ] ?unless ;
 
 : max-line-width ( wrapped-paragraph -- x )
     [ width>> ] [ max ] map-reduce ;
index e35c42d8e9744363693f606349e101be5bad1af9..6388b7ef58c13e7ce8d2a103a08f2787613e7291 100644 (file)
@@ -185,8 +185,8 @@ M: table layout*
     ] dip translate-column ;
 
 : table-column-alignment ( table -- seq )
-    dup renderer>> column-alignment
-    [ ] [ column-widths>> length 0 <repetition> ] ?if ;
+    [ renderer>> column-alignment ]
+    [ column-widths>> length 0 <repetition> ] ?unless ;
 
 :: row-font ( row index table -- font )
     table font>> clone
index 237f619f2256ec696567994efc4620d381b0c85a..978f12dd92d6d5194bd6c1038b04b89092b8c980 100644 (file)
@@ -57,7 +57,7 @@ M: propagate-gesture-tuple send-queued-gesture
 TUPLE: propagate-key-gesture-tuple gesture world ;
 
 : world-focus ( world -- gadget )
-    dup focus>> [ world-focus ] [ ] ?if ;
+    [ focus>> ] [ world-focus ] ?when ;
 
 M: propagate-key-gesture-tuple send-queued-gesture
     [ gesture>> ] [ world>> world-focus ] bi
index b80db4110b5bfa7074c1c3112a3cf8ca996a322e..cffee614fff9c9b29eefcff0fde44e3f0b479d7b 100644 (file)
@@ -54,9 +54,8 @@ operations [ <linked-hash> ] initialize
     dup primary-operation invoke-command ;
 
 : secondary-operation ( obj -- operation )
-    dup
-    [ command>> +secondary+ word-prop ] find-operation
-    [ ] [ primary-operation ] ?if ;
+    [ [ command>> +secondary+ word-prop ] find-operation ]
+    [ primary-operation ] ?unless ;
 
 : invoke-secondary-operation ( obj -- )
     dup secondary-operation invoke-command ;
index ca5340a5d58a474b38b2385fc0ac6ad476b13ded..1035954e9fbf3bbc224ca11279f43a338b42f6a9 100644 (file)
@@ -12,7 +12,7 @@ MEMO: base16colors ( name -- assoc )
     utf8 file-lines parse-colors ;
 
 : named-base16 ( name -- color )
-    dup base16-theme-name get base16colors at [ ] [ no-such-color ] ?if ;
+    [ base16-theme-name get base16colors at ] [ no-such-color ] ?unless ;
 
 SINGLETON: base16-theme
 
index 2e2318fe378826a45c8681c792c89b5345c74467..a2f01550bc3e7b0cdc2a3ac0e312c0279a26a681 100644 (file)
@@ -48,12 +48,13 @@ M: string group-struct
 PRIVATE>
 
 : group-name ( id -- string )
-    dup group-cache get [
-        ?at [ name>> ] [ number>string ] if
-    ] [
-        group-struct [ gr_name>> ] [ f ] if*
-    ] if*
-    [ ] [ number>string ] ?if ;
+    [
+        group-cache get [
+            ?at [ name>> ] [ number>string ] if
+        ] [
+            group-struct [ gr_name>> ] [ f ] if*
+        ] if*
+    ] [ number>string ] ?unless ;
 
 : group-id ( string -- id/f )
     group-struct dup [ gr_gid>> ] when ;
index 79cb7411bd70f484b4c9e31655153341192f08b1..543a5ff6c439a194b71722b5421c95c2058e1214 100644 (file)
@@ -29,7 +29,7 @@ TUPLE: url protocol username password host port path query anchor ;
 ERROR: malformed-port string ;
 
 : parse-port ( string -- port/f )
-    [ f ] [ dup string>number [ ] [ malformed-port ] ?if ] if-empty ;
+    [ f ] [ [ string>number ] [ malformed-port ] ?unless ] if-empty ;
 
 : parse-host ( string -- host/f port/f )
     [
index 360c6adcc31286f6a9b07d3e77162982b8850f0d..b78e7dc5945ddea923cdce5bf2132095ee502d60 100644 (file)
@@ -33,7 +33,7 @@ IN: validators
     ] if ;
 
 : v-number ( str -- n )
-    dup string>number [ ] [ "must be a number" throw ] ?if ;
+    [ string>number ] [ "must be a number" throw ] ?unless ;
 
 : v-integer ( str -- n )
     v-number dup integer? [ "must be an integer" throw ] unless ;
index 34522cf39fc9f6e69bb5d977eba86f2253cf3484..975a2d51a054da92b0d4698e24a0517a90a0c0ac 100644 (file)
@@ -76,7 +76,7 @@ ERROR: bad-platform name ;
 
 : vocab-platforms ( vocab -- platforms )
     "platforms.txt" vocab-file-lines
-    [ dup "system" lookup-word [ ] [ bad-platform ] ?if ] map ;
+    [ [ "system" lookup-word ] [ bad-platform ] ?unless ] map ;
 
 : supported-platform? ( platforms -- ? )
     [ t ] [ [ os swap class<= ] any? ] if-empty ;
index 6ffe19e3d33d37cd7a5c4b0f219a15d46d99ac6a..722668aa69f33d341dc11e7bfdfccf80545b3ec8 100644 (file)
@@ -6,7 +6,8 @@ namespaces sequences sets source-files vocabs vocabs.loader ;
 IN: vocabs.refresh
 
 : source-modified? ( path -- ? )
-    dup source-files get at [
+    [ source-files get at ]
+    [
         dup path>>
         dup file-exists? [
             utf8 file-lines crc32 checksum-lines
@@ -16,7 +17,7 @@ IN: vocabs.refresh
         ] if
     ] [
         file-exists?
-    ] ?if ;
+    ] ??if ;
 
 SYMBOL: changed-vocabs
 
index 27cc4b54a915f3e29c7288cc8887179904552b7a..602213d861711c4c4ec45cb89cbecdb71c7f2918 100644 (file)
@@ -36,8 +36,7 @@ IN: xml.autoencoding
 : prolog-encoding ( prolog -- )
     encoding>> dup "UTF-16" =
     [ drop ] [
-        dup name>encoding
-        [ decode-stream ] [ bad-encoding ] ?if
+        [ name>encoding ] [ decode-stream ] [ bad-encoding ] ??if
     ] if ;
 
 : instruct-encoding ( instruct/prolog -- )
index fdbc084f7faa1712e07e5ac173a1c34ea47f4cef..674fc10fbb811f153195c4c813cf8ed7d455fd2d 100644 (file)
@@ -20,7 +20,7 @@ CONSTANT: quoted-entities-out
 
 : escape-string-by ( str table -- escaped )
     ! Convert <, >, &, ' and " to HTML entities.
-    [ '[ dup _ at [ % ] [ , ] ?if ] each ] "" make ;
+    [ '[ [ _ at ] [ % ] [ , ] ??if ] each ] "" make ;
 
 : escape-string ( str -- newstr )
     entities-out escape-string-by ;
index 8166d0f3d59c1613513ed3586951f00e3279ca06..1a9677b5ab6addf136599108f37822003ea171ab 100644 (file)
@@ -24,8 +24,9 @@ SYMBOL: ns-stack
     ] { } make f like ;
 
 : add-ns ( name -- )
-    dup space>> dup ns-stack get assoc-stack
-    [ ] [ nonexist-ns ] ?if >>url drop ;
+    dup space>>
+    [ ns-stack get assoc-stack ]
+    [ nonexist-ns ] ?unless >>url drop ;
 
 : push-ns ( hash -- )
     ns-stack get push ;
index d3bec9f3dd0164d37b3b4a98297d396cd6e5ed05..10b2568003dac3e8d5ec92838a677d8647906f57 100644 (file)
@@ -27,7 +27,7 @@ IN: bootstrap.syntax
     "syntax" lookup-word t "delimiter" set-word-prop ;
 
 : define-core-syntax ( name quot -- )
-    [ dup "syntax" lookup-word [ ] [ no-word-error ] ?if ] dip
+    [ [ "syntax" lookup-word ] [ no-word-error ] ?unless ] dip
     define-syntax ;
 
 [
index 04a9b97191acddf5d8184ec61c4f5536cf457896..a4921ae0ed270ac37ab9789baf3c9ac59ad73682 100644 (file)
@@ -77,7 +77,7 @@ PRIVATE>
     ] if ;
 
 : vocab-exists? ( name -- ? )
-    dup lookup-vocab [ ] [ find-vocab-root ] ?if ;
+    [ lookup-vocab ] [ find-vocab-root ] ?unless ;
 
 : vocab-append-path ( vocab path -- newpath )
     swap find-vocab-root [ prepend-path ] [ drop f ] if* ;
@@ -148,13 +148,13 @@ PRIVATE>
     ] when* require ;
 
 : run ( vocab -- )
-    dup load-vocab vocab-main [
-        execute( -- )
-    [
+    [ load-vocab vocab-main ]
+    [ execute( -- ) ]
+    [
         "The " write vocab-name write
         " vocabulary does not define an entry point." print
         "To define one, refer to \\ MAIN: help" print
-    ] ?if ;
+    ] ??if ;
 
 <PRIVATE
 
index b56374f86882f63898c0377aacdaedd5fb48cc5c..5280784c1dd235f8da7ac14723b4b7e850930d2e 100644 (file)
@@ -131,7 +131,7 @@ GENERIC: >vocab-link ( name -- vocab )
 
 M: vocab-spec >vocab-link ;
 
-M: object >vocab-link dup lookup-vocab [ ] [ <vocab-link> ] ?if ;
+M: object >vocab-link [ lookup-vocab ] [ <vocab-link> ] ?unless ;
 
 <PRIVATE
 
index 6368dcfce221a6fa0934c6980f8adebce1c3d07c..f697c3c320c44c10e027c5026c1e97cd5a837dee 100644 (file)
@@ -210,8 +210,8 @@ M: word reset-word
     [ gensym dup ] 2dip define-declared ;
 
 : reveal ( word -- )
-    dup [ name>> ] [ vocabulary>> ] bi dup vocab-words-assoc
-    [ ] [ no-vocab ] ?if set-at ;
+    dup [ name>> ] [ vocabulary>> ] bi
+    [ vocab-words-assoc ] [ no-vocab ] ?unless set-at ;
 
 ERROR: bad-create name vocab ;
 
index ebff86d879e8ff4a7538dbff7fcaac098a8c72b1..3dac440f348a094e36d111bae1b0390547452dcb 100644 (file)
@@ -43,10 +43,11 @@ CONSTANT: (operators) { + - * / rot swap q }
     '[ name>> _ = ] find nip ;
 
 : get-operator ( operators -- word )
-    dup "Operators: %u\n" printf flush
-    dup readln find-operator [ ] [
-        "Operator not found..." print get-operator
-    ] ?if ;
+    [ "Operators: %u\n" printf flush ]
+    [
+        [ readln find-operator ]
+        [ "Operator not found..." print get-operator ] ?unless
+    ] bi ;
 
 : try-operator ( array -- array )
     [ pprint nl ]
index 69fc196ce4931df07fe2a11af48d3fa33d95170f..6a10620c8515b9f11123c3e1930c85321e9bf41b 100644 (file)
@@ -186,9 +186,3 @@ IN: combinators.extras.tests
 
 { 103 203 { { 1 1 } { 2 2 } { 3 3 } } }
 [ 100 200 { { 1 1 } { 2 2 } { 3 3 } } [ [ 1 + ] bi@ ] 2temp2d assoc-map ] unit-test
-
-{ 10 } [ 5 [ 2 * ] plox ] unit-test
-{ f } [ f [ 2 * ] plox ] unit-test
-
-{ 12 } [ 12 [ odd? ] [ 2/ ] plox-if ] unit-test
-{ 6 } [ 13 [ odd? ] [ 2/ ] plox-if ] unit-test
index 162948e6571217ec3276d73ad87b9b5ea23aa1b7..8e1f312042cd58a6da971fa4bde81685883b078e 100644 (file)
@@ -58,12 +58,6 @@ MACRO: cleave-array ( quots -- quot )
 
 : quad@ ( w x y z quot -- ) dup dup dup quad* ; inline
 
-: plox ( ... x/f quot: ( ... x -- ... y ) -- ... y/f )
-    dupd when ; inline
-
-: plox-if ( ... x quot: ( ... x -- ... ? ) quot: ( ... x -- ... y ) -- ... y/f )
-    [ keep swap ] dip when ; inline
-
 MACRO: smart-plox ( true -- quot )
     [ inputs [ 1 - [ and ] n*quot ] keep ] keep swap
     '[ _ _ [ _ ndrop f ] smart-if ] ;
index 13e9f6da2897aad66160d51e7aa1a07b1fa75bd4..a38f64a8cbb7a5ad7f795f9c5ed4d5a23be12cf1 100644 (file)
@@ -10,7 +10,7 @@ IN: compiler.cfg.gvn
 
 GENERIC: simplify ( insn -- insn' )
 
-M: insn simplify dup rewrite [ simplify ] [ dup >avail-insn-uses ] ?if ;
+M: insn simplify [ rewrite ] [ simplify ] [ dup >avail-insn-uses ] ??if ;
 M: array simplify [ simplify ] map ;
 M: ##copy simplify ;
 
@@ -37,8 +37,9 @@ M: ##copy value-number [ src>> vreg>vn ] [ dst>> ] bi set-vn ;
     insn vn vns>insns get set-at ;
 
 : check-redundancy ( insn -- )
-    dup >expr dup exprs>vns get at
-    [ redundant-instruction ] [ useful-instruction ] ?if ;
+    dup >expr
+    [ exprs>vns get at ]
+    [ redundant-instruction ] [ useful-instruction ] ??if ;
 
 M: ##phi value-number
     dup inputs>> values [ vreg>vn ] map sift
index 2b14063ad3d30c235deb6a9cb2131904c4f37014..83fedc0f832417ea3b5e13d1d1c899b2dbe3eaf3 100644 (file)
@@ -23,14 +23,14 @@ ERROR: invalid-cronentry value ;
     } cond ; inline recursive
 
 : parse-day ( str -- n )
-    dup string>number [ ] [
+    [ string>number ] [
         >lower $[ day-abbreviations3 [ >lower ] map ] index
-    ] ?if ;
+    ] ?unless ;
 
 : parse-month ( str -- n )
-    dup string>number [ ] [
+    [ string>number ] [
         >lower $[ month-abbreviations [ >lower ] map ] index
-    ] ?if ;
+    ] ?unless ;
 
 TUPLE: cronentry minutes hours days months days-of-week command ;
 
index 75a77ece974baebb2e14c01be60ed7ecb5169ca0..df12bf07bcc13a223d8c13f943e57ea2994363a8 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>> [ ] [ already-disposed ] ?if ;
+    ec-key get [ handle>> ] [ already-disposed ] ?unless ;
 
 DESTRUCTOR: BN_clear_free
 
index cd3609391fc9f1ce52727cdeb90604159b3ceb0f..da4391272bd7c979761352939a73dfd93f45626a 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>> [ ] [ base-face>> ] ?if ;
+GML: nextring ( e0 -- e1 ) [ next-ring>> ] [ base-face>> ] ?unless ;
 
 GML: facenormal ( e0 -- n ) face-normal ;
 GML: faceplanedist ( e0 -- d ) face-plane-dist ;
index 89a6250289e68fa970e1bd106c920de04d665ae2..0abcaab1315eaa22a1002fa000ecea6cf37f6f4d 100644 (file)
@@ -311,7 +311,7 @@ SYMBOL: padding-no
     { } <struct-slot-spec> ;
 
 : shader-filename ( shader/program -- filename )
-    dup filename>> [ ] [ name>> where first ] ?if file-name ;
+    [ filename>> ] [ name>> where first ] ?unless file-name ;
 
 : numbered-log-line? ( log-line-components -- ? )
     {
index 82cce19c5cf14ce2ba4b4abbede30aae6b83cc73..4c121ea5435ec32afdaf3c9d22584eb4131b1658 100644 (file)
@@ -30,7 +30,7 @@ CONSTANT: ignored-words {
 }
 
 : (word-help) ( word -- content )
-    dup "help" word-prop [ ] [ word-help* ] ?if ;
+    [ "help" word-prop ] [ word-help* ] ?unless ;
 
 GENERIC: write-object* ( object -- )
 M: string write-object* write ;
index 12aa08f226f971a7fb48a142a4390c833be2fa56..e3cf09102ac63ab301c02e82a96c13bfd561216b 100644 (file)
@@ -14,7 +14,7 @@ M: image-gadget pref-dim* image>> [ image-dim ] [ { 640 480 } ] if* ;
 : (image-gadget-texture) ( gadget -- texture )
     dup image>> { 0 0 } <texture> >>texture texture>> ;
 : image-gadget-texture ( gadget -- texture )
-    dup texture>> [ ] [ (image-gadget-texture) ] ?if ;
+    [ texture>> ] [ (image-gadget-texture) ] ?unless ;
 
 M: image-gadget draw-gadget* ( gadget -- )
     dup image>> [
index 1ab1bf41dbd15a3d5624dc9e6ee5dcbb17edd051..14da3f1a29ce7da2bc0ba75039555ef1f4fc7719 100644 (file)
@@ -102,7 +102,7 @@ M: bad-stack-effect summary
     drop "Words used in infix must declare a stack effect and return exactly one value" ;
 
 : check-word ( argcount word -- ? )
-    dup stack-effect [ ] [ bad-stack-effect ] ?if
+    [ stack-effect ] [ bad-stack-effect ] ?unless
     [ in>> length ] [ out>> length ] bi
     [ = ] dip 1 = and ;
 
index 7e3d9e5b0f67b78d9b2c5b7bd3d25409accd3409..49598e93fcbe275b2122f79114eb55e21ce7425d 100644 (file)
@@ -34,7 +34,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>> [ ] [ parameters>> ?first ] ?if ;
+M: to-channel chat-name [ channel>> ] [ parameters>> ?first ] ?unless ;
 
 GENERIC: chat> ( obj -- chat/f )
 M: string      chat> irc> chats>> at ;
index 6ed35a703888e580efb565bae4cafb276c35d1eb..b98bdeb246582e137bc2cb0030db092c0c7508b0 100644 (file)
@@ -28,7 +28,7 @@ ERROR: not-an-integer x ;
 : parse-decimal ( str -- ratio )
     split-decimal [ [ "0" ] when-empty ] bi@
     [
-        [ dup string>number [ ] [ not-an-integer ] ?if ] bi@
+        [ string>number ] [ ] [ not-an-integer ] ??if ] bi@
     ] keep length 10^ / + swap [ neg ] when ;
 
 SYNTAX: DECIMAL: scan-token parse-decimal suffix! ;
index 0f71624c5babc2f71783217f37f28a8636f0f17b..6cf4b7ec9240ebb12f2d78d9a1bd9ed48ab4e918 100644 (file)
@@ -1121,24 +1121,3 @@ INSTANCE: virtual-zip-index immutable-sequence
 
 : call-push-when ( ..a elt quot: ( ..a elt -- ..b elt' ? ) accum -- ..b )
     [ call ] dip swap [ push ] [ 2drop ] if ; inline
-
-: find-from* ( ... n seq quot: ( ... elt -- ... ? ) -- ... elt i/f )
-    '[ _ find-from-unsafe element/index ] bounds-check-call ; inline
-
-: find* ( ... seq quot: ( ... elt -- ... ? ) -- ... elt i/f )
-    [ 0 ] 2dip find-from-unsafe element/index ; inline
-
-: find-last-from* ( ... n seq quot: ( ... elt -- ... ? ) -- ... elt i/f )
-    '[ _ find-last-from-unsafe element/index ] bounds-check-call ; inline
-
-: find-last* ( ... seq quot: ( ... elt -- ... ? ) -- ... elt i/f )
-    [ index-of-last ] dip find-last-from* ; inline
-
-: find-index-from* ( ... n seq quot: ( ... elt i -- ... ? ) -- ... elt i/f )
-    '[
-        _ [ sequence-index-operator find-integer-from ] keepd
-        element/index
-    ] bounds-check-call ; inline
-
-: find-index* ( ... seq quot: ( ... elt i -- ... ? ) -- ... elt i/f )
-    [ 0 ] 2dip find-index-from* ; inline
index f34454c196d925b11e432e74b3942daacdb97452..dc11de553f2ea16be6315569af75ff1bdd3914dd 100644 (file)
@@ -76,7 +76,7 @@ spidering-site "SPIDERING_SITE" {
     spidering-site new swap >>account-name select-tuples ;
 
 : insert-site ( url -- site )
-    <site> dup select-tuple [ ] [ dup t >>up? insert-tuple ] ?if ;
+    <site> [ select-tuple ] [ dup t >>up? insert-tuple ] ?unless ;
 
 : select-account/site ( username url -- account site )
     insert-site site-id>> ;
index a0e3f07e250bfc80e703dd17a03f28696ec79868..8327b0ac39171d27b5cb507cc25aeee0e788a879 100644 (file)
@@ -144,7 +144,7 @@ ERROR: no-word name ;
 
 M: ast-foreign compile-ast
     nip
-    [ class>> dup ":" split1 lookup-word [ ] [ no-word ] ?if ]
+    [ class>> [ ":" split1 lookup-word ] [ no-word ] ?unless ]
     [ name>> ] bi define-foreign
     [ nil ] ;
 
index 7815aebfa3803b23d381b38bc00ab12f7d48ea6a..549b82696a1cf005362336eba6f8138f2c48b71e 100644 (file)
@@ -12,7 +12,7 @@ IN: smalltalk.parser
 ERROR: bad-number str ;
 
 : check-number ( str -- n )
-    >string dup string>number [ ] [ bad-number ] ?if ;
+    >string [ string>number ] [ ] [ bad-number ] ??if ;
 
 EBNF: parse-smalltalk [=[
 
index 74167d68ced9ce812890d4dacdc4f668d748a174..63315169f04aab7e799b779646c75e6d4d89c0c6 100644 (file)
@@ -21,8 +21,8 @@ ERROR: no-such-state name ;
 M: no-such-state summary drop "No such state" ;
 
 MEMO: string>state ( string -- state )
-    dup states [ name>> = ] with find nip
-    [ ] [ no-such-state ] ?if ;
+    [ states [ name>> = ] with find nip ]
+    [ no-such-state ] ?unless ;
 
 TUPLE: city
 first-zip name state latitude longitude gmt-offset dst-offset ;
index 91a14bf8b6f85e5fa73f11985361a7141519b777..5d259a3a0e5263280f95eaeec69dd2256c84cf43 100644 (file)
@@ -10,7 +10,7 @@ IN: webapps.mason.status-update
         swap >>cpu
         swap >>os
         swap >>host-name
-    dup select-tuple [ ] [ dup insert-tuple ] ?if ;
+    [ select-tuple ] [ dup insert-tuple ] ?unless ;
 
 : heartbeat ( builder -- )
     now >>heartbeat-timestamp
index 0d4388d7cbceca93a345b79ea5cf66c10143afe4..f1f9a82f936e4aab79e6477b2beb8c93f355d434 100644 (file)
@@ -26,8 +26,8 @@ short-url "SHORT_URLS" {
     '[ _ dup random-url >>short insert-tuple ] 10 retry ;
 
 : shorten ( url -- short )
-    short-url new swap >>url dup select-tuple
-    [ ] [ insert-short-url ] ?if short>> ;
+    short-url new swap >>url
+    [ select-tuple ] [ insert-short-url ] ?unless short>> ;
 
 : short>url ( short -- url )
     "$wee-url/go/" prepend >url adjust-url ;
index 404c77a8173ec6f69b9e9839cf25586d9557c621..4fab07c38f577a7983393dceaee1cfece66a6425 100644 (file)
@@ -88,12 +88,15 @@ M: revision feed-entry-url id>> revision-url ;
         [ validate-title ] >>init
 
         [
-            "title" value dup latest-revision [
+            "title" value
+            [
+                latest-revision
+            ] [
                 from-object
                 { wiki "view" } <chloe-content>
             ] [
                 edit-url <redirect>
-            ] ?if
+            ] ??if
         ] >>display
 
     <article-boilerplate> ;