Minor tweaks
parent
75456f99de
commit
4d7acd57e7
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2004, 2006 Slava Pestov.
|
! Copyright (C) 2004, 2006 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
IN: compiler
|
IN: compiler
|
||||||
USING: errors hashtables inference io kernel math
|
USING: errors hashtables inference io kernel math namespaces
|
||||||
namespaces optimizer prettyprint sequences test words ;
|
optimizer prettyprint sequences test threads words ;
|
||||||
|
|
||||||
: (compile) ( word -- )
|
: (compile) ( word -- )
|
||||||
dup specialized-def dataflow optimize generate ;
|
dup specialized-def dataflow optimize generate ;
|
||||||
|
@ -27,7 +27,7 @@ namespaces optimizer prettyprint sequences test words ;
|
||||||
: compile-vocabs ( vocabs -- )
|
: compile-vocabs ( vocabs -- )
|
||||||
[ words ] map concat
|
[ words ] map concat
|
||||||
dup [ f "no-effect" set-word-prop ] each
|
dup [ f "no-effect" set-word-prop ] each
|
||||||
[ try-compile ] each ;
|
[ try-compile yield ] each ;
|
||||||
|
|
||||||
: compile-all ( -- ) vocabs compile-vocabs ;
|
: compile-all ( -- ) vocabs compile-vocabs ;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ M: assert summary drop "Assertion failed" ;
|
||||||
|
|
||||||
: assert= ( a b -- ) 2dup = [ 2drop ] [ <assert> throw ] if ;
|
: assert= ( a b -- ) 2dup = [ 2drop ] [ <assert> throw ] if ;
|
||||||
|
|
||||||
: print-test ( input output -- ) "--> " write 2array . flush ;
|
: print-test ( input output -- )
|
||||||
|
"----> Quotation: " write .
|
||||||
|
"Expected output: " write . flush ;
|
||||||
|
|
||||||
: benchmark ( quot -- gctime runtime )
|
: benchmark ( quot -- gctime runtime )
|
||||||
millis >r gc-time >r call gc-time r> - millis r> - ;
|
millis >r gc-time >r call gc-time r> - millis r> - ;
|
||||||
|
|
Loading…
Reference in New Issue