diff --git a/basis/peg/peg.factor b/basis/peg/peg.factor index 74ce0b0337..5582d93cdf 100644 --- a/basis/peg/peg.factor +++ b/basis/peg/peg.factor @@ -240,17 +240,15 @@ TUPLE: peg-head rule-id involved-set eval-set ; ] if* ; inline : with-packrat ( input quot -- result ) - #! Run the quotation with a packrat cache active. - [ - swap input set - 0 pos set - f lrstack set - V{ } clone error-stack set - H{ } clone \ heads set - H{ } clone \ packrat set - call - ] with-scope ; inline - + #! Run the quotation with a packrat cache active. + [ + swap input ,, + 0 pos ,, + f lrstack ,, + V{ } clone error-stack ,, + H{ } clone \ heads ,, + H{ } clone \ packrat ,, + ] H{ } make swap with-variables ; inline GENERIC: (compile) ( peg -- quot ) diff --git a/extra/bank/bank-tests.factor b/extra/bank/bank-tests.factor index 0d11b11acf..c74e28f2eb 100644 --- a/extra/bank/bank-tests.factor +++ b/extra/bank/bank-tests.factor @@ -4,33 +4,31 @@ FROM: bank => balance>> ; IN: bank.tests SYMBOL: my-account -[ - "Alex's Take Over the World Fund" 0.07 1 2007 11 1 6101.94 open-account my-account set +"Alex's Take Over the World Fund" 0.07 1 2007 11 1 6101.94 open-account +my-account [ [ 6137 ] [ my-account get 2007 12 2 process-to-date balance>> round >integer ] unit-test [ 6137 ] [ my-account get 2007 12 2 process-to-date balance>> round >integer ] unit-test -] with-scope +] with-variable -[ - "Petty Cash" 0.07 1 2006 12 1 10962.18 open-account my-account set +"Petty Cash" 0.07 1 2006 12 1 10962.18 open-account +my-account [ [ 11027 ] [ my-account get 2007 1 2 process-to-date balance>> round >integer ] unit-test -] with-scope +] with-variable -[ - "Saving to buy a pony" 0.0725 1 2008 3 3 11106.24 open-account my-account set +"Saving to buy a pony" 0.0725 1 2008 3 3 11106.24 open-account +my-account [ [ 8416 ] [ - my-account get [ - 2008 3 11 -750 "Need to buy food" , - 2008 3 25 -500 "Going to a party" , - 2008 4 8 -800 "Losing interest in the pony..." , - 2008 4 8 -700 "Buying a rocking horse" , - ] { } make inserting-transactions balance>> round >integer - ] unit-test -] with-scope - -[ - [ 6781 ] [ - "..." 0.07 1 2007 4 10 4398.50 open-account - 2007 10 26 2000 "..." 1array inserting-transactions - 2008 4 10 process-to-date dup balance>> swap unpaid-interest>> + round >integer + my-account get [ + 2008 3 11 -750 "Need to buy food" , + 2008 3 25 -500 "Going to a party" , + 2008 4 8 -800 "Losing interest in the pony..." , + 2008 4 8 -700 "Buying a rocking horse" , + ] { } make inserting-transactions balance>> round >integer ] unit-test -] with-scope +] with-variable + +[ 6781 ] [ + "..." 0.07 1 2007 4 10 4398.50 open-account + 2007 10 26 2000 "..." 1array inserting-transactions + 2008 4 10 process-to-date dup balance>> swap unpaid-interest>> + round >integer +] unit-test diff --git a/extra/gdbm/gdbm.factor b/extra/gdbm/gdbm.factor index a69809f4e3..be0838404c 100644 --- a/extra/gdbm/gdbm.factor +++ b/extra/gdbm/gdbm.factor @@ -2,8 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien.c-types alien.data alien.destructors alien.enums alien.syntax classes.struct combinators destructors -gdbm.ffi io.backend kernel libc locals math namespaces sequences -serialize strings ; +fry gdbm.ffi io.backend kernel libc locals math namespaces +sequences serialize strings ; IN: gdbm ENUM: gdbm-role reader writer wrcreat newdb ; @@ -147,8 +147,10 @@ PRIVATE> : gdbm-file-descriptor ( -- desc ) dbf gdbm_fdesc ; : with-gdbm ( gdbm quot -- ) - [ gdbm-open &gdbm-close current-dbf set ] prepose curry - [ with-scope ] curry with-destructors ; inline + '[ + _ gdbm-open &gdbm-close current-dbf + _ with-variable + ] with-destructors ; inline :: with-gdbm-role ( name role quot -- ) name >>name role >>role quot with-gdbm ; inline diff --git a/extra/mason/child/child-tests.factor b/extra/mason/child/child-tests.factor index d12bd0ec0d..cc031173f1 100644 --- a/extra/mason/child/child-tests.factor +++ b/extra/mason/child/child-tests.factor @@ -3,27 +3,24 @@ USING: mason.child mason.config tools.test namespaces io kernel sequences system ; [ { "nmake" "/f" "nmakefile" "x86-32" } ] [ - [ - windows target-os set - x86.32 target-cpu set - make-cmd - ] with-scope + H{ + { target-os windows } + { target-cpu x86.32 } + } [ make-cmd ] with-variables ] unit-test [ { "make" "macosx-x86-32" } ] [ - [ - macosx target-os set - x86.32 target-cpu set - make-cmd - ] with-scope + H{ + { target-os macosx } + { target-cpu x86.32 } + } [ make-cmd ] with-variables ] unit-test [ { "./factor.com" "-i=boot.windows-x86.32.image" "-no-user-init" } ] [ - [ - windows target-os set - x86.32 target-cpu set - boot-cmd - ] with-scope + H{ + { target-os windows } + { target-cpu x86.32 } + } [ boot-cmd ] with-variables ] unit-test [ [ "Hi" print ] [ drop 3 ] [ 4 ] recover-else ] must-infer