]> gitweb.factorcode.org Git - factor.git/commitdiff
fixed fold-model
authorSam Anklesaria <sam@Tintin.local>
Sat, 30 May 2009 17:13:13 +0000 (12:13 -0500)
committerSam Anklesaria <sam@Tintin.local>
Sat, 30 May 2009 17:13:13 +0000 (12:13 -0500)
extra/ui/frp/signals/signals.factor

index 9813165b1d9e7da8123058f133f4dd4b7663e204..650acb37c80064ed4dd40b3d7dc697a8751f6fb7 100644 (file)
@@ -18,11 +18,11 @@ M: filter-model (model-changed) [ value>> ] dip 2dup quot>> call( a -- ? )
    [ set-model ] [ 2drop ] if ;
 : <filter> ( model quot -- filter-signal ) [ 1array filter-model <multi-model> ] dip >>quot ;
 
-TUPLE: fold-model < multi-model oldval quot ;
-M: fold-model (model-changed) [ [ value>> ] [ [ oldval>> ] [ quot>> ] bi ] bi*
+TUPLE: fold-model < multi-model quot ;
+M: fold-model (model-changed) [ [ value>> ] [ [ value>> ] [ quot>> ] bi ] bi*
    call( val oldval -- newval ) ] keep set-model ;
 : <fold> ( model oldval quot -- signal ) rot 1array fold-model <multi-model> swap >>quot
-   swap [ >>oldval ] [ >>value ] bi ;
+   swap >>value ;
 
 TUPLE: updater-model < multi-model values updates ;
 M: updater-model (model-changed) tuck updates>> =