release
Slava Pestov 2007-09-28 00:26:58 -04:00
parent a75c6ebb22
commit 3995a5c824
2 changed files with 16 additions and 13 deletions

View File

@ -1,25 +1,28 @@
IN: temporary IN: temporary
USING: compiler tools.test namespaces sequences USING: compiler tools.test namespaces sequences
kernel.private kernel math continuations continuations.private kernel.private kernel math continuations continuations.private
words ; words splitting ;
: symbolic-stack-trace ( -- newseq ) : symbolic-stack-trace ( -- newseq )
error-continuation get continuation-call callstack>array ; error-continuation get continuation-call callstack>array
2 group flip first ;
: foo 3 throw 7 ; : foo 3 throw 7 ;
: bar foo 4 ; : bar foo 4 ;
: baz bar 5 ; : baz bar 5 ;
\ baz compile \ baz compile
[ 3 ] [ [ baz ] catch ] unit-test [ 3 ] [ [ baz ] catch ] unit-test
[ { baz bar foo throw } ] [ [ t ] [
symbolic-stack-trace [ word? ] subset symbolic-stack-trace
[ word? ] subset
{ baz bar foo throw } tail?
] unit-test ] unit-test
: bleh [ 3 + ] map [ 0 > ] subset ; : bleh [ 3 + ] map [ 0 > ] subset ;
\ bleh compile \ bleh compile
: stack-trace-contains? symbolic-stack-trace memq? ; : stack-trace-contains? symbolic-stack-trace memq? ;
[ t ] [ [ t ] [
[ { 1 "hi" } bleh ] catch drop \ + stack-trace-contains? [ { 1 "hi" } bleh ] catch drop \ + stack-trace-contains?
] unit-test ] unit-test

View File

@ -365,17 +365,17 @@ M: object minimal-ds-loc* drop ;
2dup [ length ] 2apply <= 2dup [ length ] 2apply <=
[ drop { } swap ] [ length swap cut* ] if ; [ drop { } swap ] [ length swap cut* ] if ;
: substitute-vregs ( alist -- ) : vreg-substitution ( value vreg -- pair )
>hashtable dupd <cached> 2array ;
{ phantom-d phantom-r }
[ get substitute ] curry* each ; : substitute-vregs ( values vregs -- )
[ vreg-substitution ] 2map [ first loc? ] subset >hashtable
[ swap substitute ] curry each-phantom ;
: lazy-load ( values template -- ) : lazy-load ( values template -- )
#! Set operand vars here. #! Set operand vars here.
flip first2 2dup [ first (lazy-load) ] 2map dup rot
>r dupd [ (lazy-load) ] 2map dup r> [ >r dup value? [ value-literal ] when r> second set ] 2each
[ >r dup value? [ value-literal ] when r> set ] 2each
dupd [ <cached> ] 2map 2array flip [ first loc? ] subset
substitute-vregs ; substitute-vregs ;
: fast-input ( template -- ) : fast-input ( template -- )