compiler.tree.propagation.call-effect: hack so that call( doesn't clear the last error

db4
Slava Pestov 2010-02-03 01:48:43 +13:00
parent 26cae00eeb
commit 662eba7a67
1 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009, 2010 Slava Pestov, Daniel Ehrenberg. ! Copyright (C) 2009, 2010 Slava Pestov, Daniel Ehrenberg.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays combinators combinators.private effects USING: accessors arrays combinators combinators.private effects
fry kernel kernel.private make sequences continuations fry kernel kernel.private make namespaces sequences continuations
quotations words math stack-checker stack-checker.dependencies quotations words math stack-checker stack-checker.dependencies
combinators.short-circuit stack-checker.transforms combinators.short-circuit stack-checker.transforms
compiler.tree.propagation.info compiler.tree.propagation.info
@ -63,7 +63,11 @@ M: compose cached-effect
[ first>> ] [ second>> ] bi [ cached-effect ] bi@ compose-effects* ; [ first>> ] [ second>> ] bi [ cached-effect ] bi@ compose-effects* ;
: safe-infer ( quot -- effect ) : safe-infer ( quot -- effect )
[ [ infer ] [ 2drop +unknown+ ] recover ] without-dependencies ; ! Save and restore error variables here, so that we don't
! pollute words such as :error and :c for the user.
error get-global error-continuation get-global
[ [ [ infer ] [ 2drop +unknown+ ] recover ] without-dependencies ] 2dip
[ error set-global ] [ error-continuation set-global ] bi* ;
: cached-effect-valid? ( quot -- ? ) : cached-effect-valid? ( quot -- ? )
cache-counter>> effect-counter eq? ; inline cache-counter>> effect-counter eq? ; inline