: (infer-value) ( value-info -- effect )
dup literal?>> [
literal>>
- [ callable? [ uninferable ] unless ]
- [ already-inlined-quot? [ uninferable ] when ]
- [ safe-infer dup +unknown+ = [ uninferable ] when ] tri
+ [ callable? [ throw-uninferable ] unless ]
+ [ already-inlined-quot? [ throw-uninferable ] when ]
+ [ safe-infer dup +unknown+ = [ throw-uninferable ] when ] tri
] [
dup class>> {
{ \ curry [ slots>> third (infer-value) remove-effect-input ] }
{ \ compose [ slots>> last2 [ (infer-value) ] bi@ compose-effects ] }
- [ uninferable ]
+ [ throw-uninferable ]
} case
] if ;
: check-outputs ( #call infos -- infos )
over out-d>> over [ length ] bi@ =
- [ nip ] [ invalid-outputs ] if ;
+ [ nip ] [ throw-invalid-outputs ] if ;
: call-outputs-quot ( #call word -- infos )
dupd
: check-effect ( quot word -- )
2dup [ infer ] [ stack-effect ] bi* effect<=
- [ 2drop ] [ bad-partial-eval ] if ;
+ [ 2drop ] [ throw-bad-partial-eval ] if ;
:: define-partial-eval ( word quot n -- )
word [