diff --git a/core/graphs/graphs.factor b/core/graphs/graphs.factor index f2003641de..fabe2afb4d 100644 --- a/core/graphs/graphs.factor +++ b/core/graphs/graphs.factor @@ -42,7 +42,7 @@ SYMBOL: previous 2drop ] [ over previous get conjoin - dup slip + [ call ] keep [ nip (closure) ] curry assoc-each ] if ; inline recursive diff --git a/core/io/encodings/encodings.factor b/core/io/encodings/encodings.factor index ab9d297d6c..4385bab9d6 100644 --- a/core/io/encodings/encodings.factor +++ b/core/io/encodings/encodings.factor @@ -61,9 +61,8 @@ M: decoder stream-read1 : (read) ( n quot -- n string ) over 0 [ [ - slip over - [ swapd set-nth-unsafe f ] [ 3drop t ] if - ] 2curry find-integer + over [ swapd set-nth-unsafe f ] [ 3drop t ] if + ] curry compose find-integer ] keep ; inline : finish-read ( n string -- string/f ) diff --git a/core/kernel/kernel.factor b/core/kernel/kernel.factor index 0432a5250c..886bb3948e 100644 --- a/core/kernel/kernel.factor +++ b/core/kernel/kernel.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2004, 2008 Slava Pestov. +! Copyright (C) 2004, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: kernel.private slots.private math.private classes.tuple.private ; @@ -227,7 +227,7 @@ PRIVATE> ! Loops : loop ( pred: ( -- ? ) -- ) - dup slip swap [ loop ] [ drop ] if ; inline recursive + [ call ] keep [ loop ] curry when ; inline recursive : do ( pred body tail -- pred body tail ) over 3dip ; inline diff --git a/core/math/math.factor b/core/math/math.factor index 322537b551..42786ffc9d 100755 --- a/core/math/math.factor +++ b/core/math/math.factor @@ -120,7 +120,7 @@ M: float fp-infinity? ( float -- ? ) : iterate-step ( i n quot -- i n quot ) #! Apply quot to i, keep i and quot, hide n. - swap [ 2dup 2slip ] dip swap ; inline + [ nip call ] 3keep ; inline : iterate-next ( i n quot -- i' n quot ) [ 1+ ] 2dip ; inline @@ -158,7 +158,7 @@ PRIVATE> over 0 < [ 2drop f ] [ - 2dup 2slip rot [ + [ call ] 2keep rot [ drop ] [ [ 1- ] dip find-last-integer diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index 63df6c9d27..44cc2595a9 100755 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -416,7 +416,7 @@ PRIVATE> over map-into ; inline : accumulate ( seq identity quot -- final newseq ) - swapd [ pick slip ] curry map ; inline + swapd [ [ call ] [ 2drop ] 3bi ] curry map ; inline : 2each ( seq1 seq2 quot -- ) (2each) each-integer ; inline @@ -825,7 +825,8 @@ PRIVATE> [ but-last-slice ] [ peek ] bi ; inline : ( seq -- slice ) - dup slice? [ { } like ] when 0 over length rot ; + dup slice? [ { } like ] when + [ drop 0 ] [ length ] [ ] tri ; inline : supremum ( seq -- n ) [ ] [ max ] map-reduce ; -: sigma ( seq quot -- n ) [ 0 ] 2dip [ rot slip + ] curry each ; inline +: sigma ( seq quot -- n ) + [ 0 ] 2dip [ dip + ] curry [ swap ] prepose each ; inline : count ( seq quot -- n ) [ 1 0 ? ] compose sigma ; inline