]> gitweb.factorcode.org Git - factor.git/commitdiff
factor: use in-out word
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 11 Feb 2023 01:58:34 +0000 (19:58 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 26 Feb 2023 23:11:03 +0000 (17:11 -0600)
12 files changed:
basis/combinators/smart/smart.factor
basis/compiler/tree/debugger/debugger.factor
basis/help/help.factor
basis/help/lint/checks/checks.factor
basis/http/client/client.factor
basis/io/streams/duplex/duplex.factor
basis/regexp/disambiguate/disambiguate.factor
basis/stack-checker/inlining/inlining.factor
basis/tools/scaffold/scaffold.factor
extra/help/lint/coverage/coverage.factor
extra/math/dual/dual.factor
extra/smalltalk/compiler/compiler-tests.factor

index 8b597a58b4b76c23e5247862084153fd3b016c4d..6bbdbc36cb5fb1af6f287f4c5e5374f3fe1fbdfa 100644 (file)
@@ -14,7 +14,7 @@ GENERIC: infer-known* ( known -- effect )
     ] [ infer-known* ] if ;
 
 IDENTITY-MEMO: inputs/outputs ( quot -- in out )
-    infer [ in>> ] [ out>> ] bi 2length ;
+    infer in-out 2length ;
 
 : inputs ( quot -- n ) inputs/outputs drop ; inline
 
@@ -24,7 +24,7 @@ IDENTITY-MEMO: inputs/outputs ( quot -- in out )
     peek-d
     infer-known [
         [ pop-d 1array #drop, ]
-        [ [ in>> ] [ out>> ] bi [ length apply-object ] bi@ ] bi*
+        [ in-out [ length apply-object ] bi@ ] bi*
     ] [
         \ inputs/outputs dup required-stack-effect apply-word/effect
         pop-d pop-d swap
index c2c0f2e0bedf4729920c92b9d7214b358b6fedda..ab1b267547c0ee01714a4b1fedb45967d61b01a1 100644 (file)
@@ -26,7 +26,7 @@ MACRO: match-choose ( alist -- quot )
 MATCH-VARS: ?a ?b ?c ;
 
 : pretty-shuffle ( effect -- word/f )
-    [ in>> ] [ out>> ] bi 2array {
+    in-out 2array {
         { { { } { } } [ ] }
         { { { ?a } { ?a } } [ ] }
         { { { ?a ?b } { ?a ?b } } [ ] }
index f99b0eb6d5efa13217b128cbc650239cfa6aee4c..0ab8a74765a91214afcd96307657c28a5c03fcca 100644 (file)
@@ -14,7 +14,7 @@ GENERIC: word-help* ( word -- content )
 : inputs-and-outputs ( content word -- content' word )
    over [ dup array? [ { $values } head? ] [ drop f ] if ] find drop [
         '[ _ cut unclip rest ] dip [
-            stack-effect [ in>> ] [ out>> ] bi
+            stack-effect in-out
             [ [ dup pair? [ first ] when ] map ] bi@
             [ '[ ?first _ member? ] filter ] bi-curry@
             \ $inputs \ $outputs
@@ -37,7 +37,7 @@ PRIVATE>
     inputs-and-outputs fix-shuffle drop ;
 
 : effect-help ( effect -- content )
-    [ in>> ] [ out>> ] bi [
+    in-out [
         [
             dup pair? [
                 first2 dup effect? [ \ $quotation swap 2array ] when
index a6084b2da6302f52ed35a36d9a28aca67e81da7c..2b1a19f882ddae2a83f513ad27c479eacba85c85 100644 (file)
@@ -71,7 +71,7 @@ SYMBOL: vocab-articles
 
 : effect-values ( word -- seq )
     stack-effect
-    [ in>> ] [ out>> ] bi append
+    in-out append
     [ dup pair? [ first ] when effect>string ] map members ;
 
 : effect-effects ( word -- seq )
index 2ad5a55d0b57227ae6d7bca6f3014013124c7fca..f743d42e7d752e1a5013d6917ba9d821ab5f8781 100644 (file)
@@ -223,7 +223,7 @@ SYMBOL: redirects
     request [
         <request-socket> [
             [
-                [ in>> ] [ out>> ] bi
+                in-out
                 [ ?https-tunnel ] with-streams*
             ]
             [
index 1ba6276c7cb4216424b3fa4ecf8df02ef827995b..7dc493b2f67ad345d2afd0479529a4edf12ac46c 100644 (file)
@@ -1,8 +1,7 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See https://factorcode.org/license.txt for BSD license.
-USING: kernel continuations destructors io io.encodings
-io.encodings.private io.timeouts io.ports io.styles summary
-accessors delegate delegate.protocols ;
+USING: accessors delegate delegate.protocols destructors effects
+io io.encodings io.ports io.styles io.timeouts kernel ;
 IN: io.streams.duplex
 
 TUPLE: duplex-stream in out ;
@@ -16,7 +15,7 @@ CONSULT: formatted-output-stream-protocol duplex-stream out>> ;
 INSTANCE: duplex-stream input-stream
 INSTANCE: duplex-stream output-stream
 
-: >duplex-stream< ( stream -- in out ) [ in>> ] [ out>> ] bi ; inline
+: >duplex-stream< ( stream -- in out ) in-out ; inline
 
 M: duplex-stream stream-element-type
     >duplex-stream<
index 2d16ab0cd9a33fdc08ada72bd13f8f43639252b0..20b52ea6116ac47e6558889ebd043a0960e07b2f 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2009 Daniel Ehrenberg.
 ! See https://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs kernel math math.bits regexp.ast
-regexp.classes regexp.transition-tables sequences sets ;
+USING: accessors arrays assocs effects kernel math math.bits
+regexp.ast regexp.classes regexp.transition-tables sequences
+sets ;
 IN: regexp.disambiguate
 
 TUPLE: parts in out ;
@@ -26,7 +27,7 @@ TUPLE: parts in out ;
     [ nip in>> ] [ out>> append ] 2bi parts boa ;
 
 : meaningful-integers ( partition table -- integers )
-    [ [ in>> ] [ out>> ] bi ] dip
+    [ in-out ] dip
     '[ [ _ at ] map intersect-all ] bi@ diff ;
 
 : class-integers ( classes integers -- table )
index d89d7be630bebedc7c9b8452d9207b288344e855..291e05c9a554982c6f2a00a17fddf79665bc8910 100644 (file)
@@ -126,7 +126,7 @@ M: declared-effect (undeclared-known) known>> (undeclared-known) ;
     [ check-call-height ] [ check-call-site-stack ] bi ;
 
 : adjust-stack-effect ( effect -- effect' )
-    [ in>> ] [ out>> ] bi
+    in-out
     meta-d length pick length [-]
     object <repetition> '[ _ prepend ] bi@
     <effect> ;
index 606927dee4d1960cf5086bbaf305ee00ad8a994e..b19357cec915fc4089f46ef704716e672a403859 100644 (file)
@@ -2,7 +2,7 @@
 ! See https://factorcode.org/license.txt for BSD license.
 USING: accessors alien arrays assocs byte-arrays calendar
 classes classes.error combinators combinators.short-circuit
-continuations eval hashtables help.markup interpolate io
+continuations effects eval hashtables help.markup interpolate io
 io.directories io.encodings.utf8 io.files io.pathnames
 io.streams.string kernel math math.parser namespaces prettyprint
 quotations sequences sets sorting splitting strings system
@@ -173,7 +173,7 @@ M: object add-using
 
 : $values. ( word -- )
     "declared-effect" word-prop [
-        [ in>> ] [ out>> ] bi
+        in-out
         2dup [ empty? ] both? [
             2drop
         ] [
index ddfbcc6b7fe57070dcd0f7d55239ca95973426c6..82cce19c5cf14ce2ba4b4abbede30aae6b83cc73 100644 (file)
@@ -98,7 +98,7 @@ M: word-help-coverage summary
 : ?remove-$values ( word spec -- spec )
     \ $values over member? [
         swap "declared-effect" word-prop [
-            [ in>> ] [ out>> ] bi append [
+            in-out append [
                 \ $values swap remove
             ] [ drop ] if-empty
     ] when* ] [ nip ] if ;
index 46a71701e49e2dee6123236f88dc9ee3d4d4b36f..7ade1e3f5ba911b766958390fa4d24e12280a080 100644 (file)
@@ -49,7 +49,7 @@ MACRO: chain-rule ( word -- e )
 : set-dual-help ( dword word -- )
     [
         [
-            stack-effect [ in>> ] [ out>> ] bi append
+            stack-effect in-out append
             [ dual ] { } map>assoc { $values } prepend
         ] [
             [
index 40adbc8dc9b534dea0dd4e6c889d3e2d8ff9e36b..4f37fa601237289db275690d609f1aa157d418f3 100644 (file)
@@ -10,7 +10,7 @@ IN: smalltalk.compiler.tests
     ] with-compilation-unit ;
 
 : test-inference ( ast -- in# out# )
-    test-compilation infer [ in>> ] [ out>> ] bi 2length ;
+    test-compilation infer in-out 2length ;
 
 { 2 1 } [
     T{ ast-block f