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 ;
: cache ( key assoc quot -- value )
2over at [
2over at* [
>r 3drop r>
] [
pick rot >r >r call dup r> r> set-at
] if* ; inline
drop pick rot >r >r call dup r> r> set-at
] if ; inline
: change-at ( key assoc quot -- )
[ >r at r> call ] 3keep drop set-at ; inline