factor: put inline on same line as ; for experimentation

db4
Doug Coleman 2015-08-10 12:55:27 -05:00
parent 4962151111
commit 00338f62f3
14 changed files with 25 additions and 32 deletions

View File

@ -23,8 +23,7 @@ IN: binary-search
PRIVATE>
: search ( seq quot: ( elt -- <=> ) -- i elt )
over empty? [ 2drop f f ] [ [ 0 over length ] dip (search) ] if ;
inline
over empty? [ 2drop f f ] [ [ 0 over length ] dip (search) ] if ; inline
GENERIC: natural-search ( obj seq -- i elt )
M: object natural-search [ <=> ] with search ;

View File

@ -248,8 +248,7 @@ SPECIAL-OBJECT: undefined-quot 65
: emit-object ( class quot -- addr )
[ type-number ] dip over here-as
[ swap emit-header call align-here ] dip ;
inline
[ swap emit-header call align-here ] dip ; inline
! Write an object to the image.
GENERIC: ' ( obj -- ptr )

View File

@ -53,5 +53,5 @@ IN: compiler.tree.combinators
: until-fixed-point ( ... #recursive quot: ( ... node -- ... ) -- ... )
over label>> t >>fixed-point drop
[ with-scope ] 2keep
over label>> fixed-point>> [ 2drop ] [ until-fixed-point ] if ;
inline recursive
over label>> fixed-point>>
[ 2drop ] [ until-fixed-point ] if ; inline recursive

View File

@ -108,8 +108,8 @@ SYMBOL: changed?
: while-changing ( ... quot: ( ... -- ... ) -- ... )
changed? off
[ call ] [ changed? get [ while-changing ] [ drop ] if ] bi ;
inline recursive
[ call ]
[ changed? get [ while-changing ] [ drop ] if ] bi ; inline recursive
: detect-loops ( call-graph -- )
HS{ } clone not-loops set

View File

@ -17,12 +17,12 @@ GENERIC: cancel-operation ( obj -- )
[ '[ _ cancel-operation ] ] dip later ;
: with-timeout* ( obj timeout quot -- )
2over queue-timeout [ nip call ] dip stop-timer ;
inline
2over queue-timeout
[ nip call ] dip stop-timer ; inline
: with-timeout ( obj quot -- )
over timeout [ [ dup timeout ] dip with-timeout* ] [ call ] if ;
inline
over timeout
[ [ dup timeout ] dip with-timeout* ] [ call ] if ; inline
: timeouts ( dt -- )
[ input-stream get set-timeout ]

View File

@ -346,8 +346,9 @@ FORGET: bad-recursion-3
{ 2 0 } [ drop f f [ 2drop "A" throw ] [ ] if 2drop ] must-infer-as
: unbalanced-retain-usage ( a b -- )
dup 10 < [ 2drop 5 1 + unbalanced-retain-usage ] [ 2drop ] if ;
inline recursive
dup 10 <
[ 2drop 5 1 + unbalanced-retain-usage ]
[ 2drop ] if ; inline recursive
[ [ unbalanced-retain-usage ] infer ] [ inference-error? ] must-fail-with

View File

@ -270,8 +270,7 @@ TUPLE: nested-pane-stream < pane-stream style parent ;
: new-nested-pane-stream ( style parent class -- stream )
new
swap >>parent
swap <pane> apply-wrap-style [ >>style ] [ >>pane ] bi* ;
inline
swap <pane> apply-wrap-style [ >>style ] [ >>pane ] bi* ; inline
: unnest-pane-stream ( stream -- child parent )
[ [ style>> ] [ pane>> smash-pane ] bi style-pane ] [ parent>> ] bi ;

View File

@ -175,8 +175,7 @@ M: bignum (log2) bignum-log2 ; inline
zero? [
dup 2 bitand zero? not rot or [ 1 + ] when
] [ nip 1 + ] if
] [ drop nip ] if ;
inline
] [ drop nip ] if ; inline
! Fourth step: post-scaling
! Because of rounding, our mantissa with guard bit is now in the

View File

@ -135,8 +135,7 @@ PRIVATE>
: sort ( seq quot: ( obj1 obj2 -- <=> ) -- sortedseq )
[ <merge> ] dip
[ sort-pairs ] [ sort-loop ] [ drop accum>> underlying>> ] 2tri ;
inline
[ sort-pairs ] [ sort-loop ] [ drop accum>> underlying>> ] 2tri ; inline
: natural-sort ( seq -- sortedseq ) [ <=> ] sort ;

View File

@ -28,8 +28,7 @@ IN: benchmark.beust2
] any? ; inline recursive
:: count-numbers ( max listener -- )
10 iota [ 1 + 1 1 0 max listener (count-numbers) ] any? drop ;
inline
10 iota [ 1 + 1 1 0 max listener (count-numbers) ] any? drop ; inline
:: beust2-benchmark ( -- )
0 :> i!

View File

@ -2,8 +2,9 @@ USING: math kernel hints prettyprint io combinators ;
IN: benchmark.recursive
: fib ( m -- n )
dup 2 < [ drop 1 ] [ [ 1 - fib ] [ 2 - fib ] bi + ] if ;
inline recursive
dup 2 <
[ drop 1 ]
[ [ 1 - fib ] [ 2 - fib ] bi + ] if ; inline recursive
: ack ( m n -- x )
{

View File

@ -56,15 +56,13 @@ STRUCT: yuv-buffer
drop 516 * 128 + swap 298 * + -8 shift clamp ; inline
: compute-green ( y u v -- g )
[ [ 298 * ] dip 100 * - ] dip 208 * - 128 + -8 shift clamp ;
inline
[ [ 298 * ] dip 100 * - ] dip 208 * - 128 + -8 shift clamp ; inline
: compute-red ( y u v -- g )
nip 409 * swap 298 * + 128 + -8 shift clamp ; inline
: compute-rgb ( y u v -- b g r )
[ compute-blue ] [ compute-green ] [ compute-red ] 3tri ;
inline
[ compute-blue ] [ compute-green ] [ compute-red ] 3tri ; inline
: store-rgb ( index rgb b g r -- index )
[ pick 0 + pick set-nth-unsafe ]

View File

@ -242,8 +242,7 @@ DEFER: (d)
dup length [ graded-triple ] with map ;
: graded-laplacian ( generators quot -- seq )
[ basis graded graded-triples [ first3 ] ] dip compose map ;
inline
[ basis graded graded-triples [ first3 ] ] dip compose map ; inline
: graded-laplacian-betti ( generators -- seq )
[ laplacian-betti ] graded-laplacian ;

View File

@ -212,8 +212,8 @@ PRIVATE>
: ((each-from)) ( i seq -- n quot )
[ length over [-] swap ] keep '[ _ + _ nth-unsafe ] ; inline
: (each-from) ( i seq quot -- n quot' ) [ ((each-from)) ] dip compose ;
inline
: (each-from) ( i seq quot -- n quot' )
[ ((each-from)) ] dip compose ; inline
PRIVATE>