Fix cache to handle the case of 'f' being a valid cached value

db4
Chris Double 2008-03-27 11:23:19 +13:00
parent c793a381fe
commit bd33e2fef9
1 changed files with 3 additions and 3 deletions

View File

@ -134,11 +134,11 @@ M: assoc assoc-clone-like ( assoc exemplar -- newassoc )
(substitute) map ; (substitute) map ;
: cache ( key assoc quot -- value ) : cache ( key assoc quot -- value )
2over at [ 2over at* [
>r 3drop r> >r 3drop r>
] [ ] [
pick rot >r >r call dup r> r> set-at drop pick rot >r >r call dup r> r> set-at
] if* ; inline ] if ; inline
: change-at ( key assoc quot -- ) : change-at ( key assoc quot -- )
[ >r at r> call ] 3keep drop set-at ; inline [ >r at r> call ] 3keep drop set-at ; inline