inferred-effect word prop is just a boolean now, not an effect object
parent
1951d739a0
commit
f1d20719b2
|
@ -146,11 +146,10 @@ M: object apply-object push-literal ;
|
||||||
[ 3drop ] [ effect-error ] if ;
|
[ 3drop ] [ effect-error ] if ;
|
||||||
|
|
||||||
: finish-word ( word -- )
|
: finish-word ( word -- )
|
||||||
current-effect
|
[ current-effect check-effect ]
|
||||||
[ check-effect ]
|
[ recorded get push ]
|
||||||
[ drop recorded get push ]
|
[ t "inferred-effect" set-word-prop ]
|
||||||
[ "inferred-effect" set-word-prop ]
|
tri ;
|
||||||
2tri ;
|
|
||||||
|
|
||||||
: cannot-infer-effect ( word -- * )
|
: cannot-infer-effect ( word -- * )
|
||||||
"cannot-infer" word-prop throw ;
|
"cannot-infer" word-prop throw ;
|
||||||
|
|
|
@ -44,9 +44,7 @@ M: effect effect>string ( effect -- string )
|
||||||
|
|
||||||
GENERIC: stack-effect ( word -- effect/f )
|
GENERIC: stack-effect ( word -- effect/f )
|
||||||
|
|
||||||
M: word stack-effect
|
M: word stack-effect "declared-effect" word-prop ;
|
||||||
{ "declared-effect" "inferred-effect" }
|
|
||||||
swap props>> [ at ] curry map [ ] find nip ;
|
|
||||||
|
|
||||||
M: deferred stack-effect call-next-method (( -- * )) or ;
|
M: deferred stack-effect call-next-method (( -- * )) or ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue