] [ infer-known* ] if ;
IDENTITY-MEMO: inputs/outputs ( quot -- in out )
- infer in-out 2length ;
+ infer [ in>> ] [ out>> ] bi 2length ;
: inputs ( quot -- n ) inputs/outputs drop ; inline
peek-d
infer-known [
[ pop-d 1array #drop, ]
- [ in-out [ length apply-object ] bi@ ] bi*
+ [ [ in>> ] [ out>> ] bi [ length apply-object ] bi@ ] bi*
] [
\ inputs/outputs dup required-stack-effect apply-word/effect
pop-d pop-d swap
MATCH-VARS: ?a ?b ?c ;
: pretty-shuffle ( effect -- word/f )
- in-out 2array {
+ [ in>> ] [ out>> ] bi 2array {
{ { { } { } } [ ] }
{ { { ?a } { ?a } } [ ] }
{ { { ?a ?b } { ?a ?b } } [ ] }
: effect-values ( word -- seq )
stack-effect
- in-out append
+ [ in>> ] [ out>> ] bi append
[ dup pair? [ first ] when effect>string ] map members ;
: effect-effects ( word -- seq )
request [
<request-socket> [
[
- in-out [ ?https-tunnel ] with-streams*
+ [ in>> ] [ out>> ] bi [ ?https-tunnel ] with-streams*
]
[
out>>
INSTANCE: duplex-stream input-stream
INSTANCE: duplex-stream output-stream
-: >duplex-stream< ( stream -- in out ) in-out ; inline
+: >duplex-stream< ( stream -- in out ) [ in>> ] [ out>> ] bi ; inline
M: duplex-stream stream-element-type
>duplex-stream<
[ nip in>> ] [ out>> append ] 2bi parts boa ;
: meaningful-integers ( partition table -- integers )
- [ in-out ] dip
+ [ [ in>> ] [ out>> ] bi ] dip
'[ [ _ at ] map intersect-all ] bi@ diff ;
: class-integers ( classes integers -- table )
[ check-call-height ] [ check-call-site-stack ] bi ;
: adjust-stack-effect ( effect -- effect' )
- in-out meta-d length pick length [-]
+ [ in>> ] [ out>> ] bi meta-d length pick length [-]
object <repetition> '[ _ prepend ] bi@
<effect> ;
: ?remove-$values ( word spec -- spec )
\ $values over member? [
swap "declared-effect" word-prop [
- in-out append [
+ [ in>> ] [ out>> ] bi append [
\ $values swap remove
] [ drop ] if-empty
] when* ] [ nip ] if ;
: set-dual-help ( dword word -- )
[
[
- stack-effect in-out append
+ stack-effect [ in>> ] [ out>> ] bi append
[ dual ] { } map>assoc { $values } prepend
] [
[
] with-compilation-unit ;
: test-inference ( ast -- in# out# )
- test-compilation infer in-out 2length ;
+ test-compilation infer [ in>> ] [ out>> ] bi 2length ;
{ 2 1 } [
T{ ast-block f