models.illusion allows multiple refs for original

db4
Sam Anklesaria 2009-05-15 19:31:43 -05:00
parent 38e8565555
commit 611b3638f4
1 changed files with 2 additions and 6 deletions

View File

@ -7,10 +7,6 @@ TUPLE: illusion < arrow ;
illusion new V{ } clone >>connections V{ } clone >>dependencies 0 >>ref
swap >>quot over >>model [ add-dependency ] keep ;
: backtalk ( value object -- ) [ quot>> [undo] call( a -- b ) ] [ model>> ] bi (>>value) ;
: backtalk ( value object -- ) [ quot>> [undo] call( a -- b ) ] [ model>> ] bi set-model ;
IN: accessors
M: illusion (>>value) ( value object -- ) swap throw [ call-next-method ] 2keep
dup [ quot>> ] [ model>> ] bi and
[ backtalk ]
[ 2drop ] if ;
M: illusion update-model ( model -- ) [ [ value>> ] keep backtalk ] with-locked-model ;