Fix cache to handle the case of 'f' being a valid cached value
							parent
							
								
									c793a381fe
								
							
						
					
					
						commit
						bd33e2fef9
					
				| 
						 | 
					@ -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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue