remove infer-only nonsense

cvs
Slava Pestov 2005-09-23 03:18:12 +00:00
parent 2a48d86e97
commit b45b514404
4 changed files with 8 additions and 17 deletions

View File

@ -34,25 +34,21 @@ TUPLE: continuation data c call name catch ;
: ifcc ( terminator balance -- | quot: continuation -- )
[
t continuation
dup continuation-data dup pop* f swap push
swap >r -rot r>
] call -rot ifte ; inline
continuation
dup continuation-data f over push f swap push t
] call 2swap ifte ; inline
: infer-only ( quot -- )
#! For stack effect inference, pretend the quotation is
#! there, but ignore it during execution.
drop ;
: (continue-with) 9 getenv ;
: callcc1 ( quot -- | quot: continuation -- )
#! Call a quotation with the current continuation, which may
#! be restored using continue-with.
[ [ drop ] infer-only 9 getenv ] ifcc ; inline
[ drop (continue-with) ] ifcc ; inline
: callcc0 ( quot -- | quot: continuation -- )
#! Call a quotation with the current continuation, which may
#! be restored using continue-with.
[ [ drop ] infer-only ] ifcc ; inline
[ drop ] ifcc ; inline
: continue ( continuation -- )
#! Restore a continuation.

View File

@ -30,7 +30,7 @@ TUPLE: no-method object generic ;
#! and run the cleanup quotation. Then throw the error to
#! the next outermost catch handler.
[ >c >r call c> drop r> call ]
[ [ drop ] infer-only 9 getenv >r nip call r> rethrow ] ifcc ; inline
[ drop (continue-with) >r nip call r> rethrow ] ifcc ; inline
: recover ( try recovery -- | try: -- | recovery: error -- )
#! Call the try quotation. If an exception is thrown in the
@ -38,6 +38,6 @@ TUPLE: no-method object generic ;
#! push the exception on the datastack, and call the
#! recovery quotation.
[ >c drop call c> drop ]
[ [ drop ] infer-only 9 getenv rot drop swap call ] ifcc ; inline
[ drop (continue-with) rot drop swap call ] ifcc ; inline
GENERIC: error. ( error -- )

View File

@ -526,6 +526,3 @@ prettyprint ;
] "infer" set-word-prop
\ flush-icache [ [ ] [ ] ] "infer-effect" set-word-prop
\ infer-only [ [ object ] [ ] ] "infer-effect" set-word-prop
\ infer-only [ pop-literal infer-quot-value ] "infer" set-word-prop

View File

@ -21,8 +21,6 @@ USING: hashtables kernel lists namespaces sequences strings ;
: file-extension ( filename -- extension )
"." split cdr dup [ peek ] when ;
DEFER: <file-reader>
: resource-path ( path -- path )
"resource-path" get [ "." ] unless* swap path+ ;