inferred-effect word prop is just a boolean now, not an effect object

db4
Slava Pestov 2009-02-23 20:51:14 -06:00
parent 1951d739a0
commit f1d20719b2
2 changed files with 5 additions and 8 deletions

View File

@ -146,11 +146,10 @@ M: object apply-object push-literal ;
[ 3drop ] [ effect-error ] if ;
: finish-word ( word -- )
current-effect
[ check-effect ]
[ drop recorded get push ]
[ "inferred-effect" set-word-prop ]
2tri ;
[ current-effect check-effect ]
[ recorded get push ]
[ t "inferred-effect" set-word-prop ]
tri ;
: cannot-infer-effect ( word -- * )
"cannot-infer" word-prop throw ;

View File

@ -44,9 +44,7 @@ M: effect effect>string ( effect -- string )
GENERIC: stack-effect ( word -- effect/f )
M: word stack-effect
{ "declared-effect" "inferred-effect" }
swap props>> [ at ] curry map [ ] find nip ;
M: word stack-effect "declared-effect" word-prop ;
M: deferred stack-effect call-next-method (( -- * )) or ;