combinators: ricing call-effect

db4
Slava Pestov 2010-02-01 21:10:11 +13:00
parent 31cf64eb84
commit 2879299999
1 changed files with 6 additions and 5 deletions

View File

@ -24,14 +24,15 @@ SLOT: in
SLOT: out SLOT: out
: call-effect ( quot effect -- ) : call-effect ( quot effect -- )
! Don't use fancy combinators here, since this word always
! runs unoptimized
[ datastack ] 2dip [ datastack ] 2dip
[ 2dup [
[ dip ] dip [ dip ] dip
[ in>> length ] [ out>> length ] bi dup in>> length swap out>> length
check-datastack check-datastack
] ] 2dip
[ [ wrong-values ] 2curry ] 2bi [ 2drop ] [ wrong-values ] if ;
unless ;
: execute-effect ( word effect -- ) : execute-effect ( word effect -- )
[ [ execute ] curry ] dip call-effect ; [ [ execute ] curry ] dip call-effect ;