From 3adff7ebe90877e81f5513b3af0e7ccbe8b1a5bb Mon Sep 17 00:00:00 2001 From: Sam Anklesaria Date: Sat, 30 May 2009 12:13:13 -0500 Subject: [PATCH] fixed fold-model --- extra/ui/frp/signals/signals.factor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extra/ui/frp/signals/signals.factor b/extra/ui/frp/signals/signals.factor index 9813165b1d..650acb37c8 100644 --- a/extra/ui/frp/signals/signals.factor +++ b/extra/ui/frp/signals/signals.factor @@ -18,11 +18,11 @@ M: filter-model (model-changed) [ value>> ] dip 2dup quot>> call( a -- ? ) [ set-model ] [ 2drop ] if ; : ( model quot -- filter-signal ) [ 1array filter-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 ; : ( model oldval quot -- signal ) rot 1array fold-model swap >>quot - swap [ >>oldval ] [ >>value ] bi ; + swap >>value ; TUPLE: updater-model < multi-model values updates ; M: updater-model (model-changed) tuck updates>> =