combinators: ricing call-effect
parent
31cf64eb84
commit
2879299999
|
@ -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 ;
|
||||||
|
|
Loading…
Reference in New Issue