: query->rr ( query -- rr ) [ name>> ] [ type>> ] [ class>> ] tri f f rr boa ; ! this one looks good enough imho : query+entry->rrs ( query entry -- rrs ) [ query->rr ] dip dup time>> time->ttl >>ttl [ data>> ] dip [ clone swap >>rdata ] curry map :: (cache-get*) ( query table -- rrs/NX/f ) table { { [ f = ] [ f ] } ! not in the cache { [ expired? ] [ query table-rem f ] } ! here but expired { [ nx? ] [ NX ] } ! negative result cached { [ t ] [ query table query+entry->rrs ] } ! good to go } cond' ; ! hypothetical combinator ;) (dups before all predicates, eats it's argument) : cache-get* ( query -- rrs/NX/f ) dup table-get (cache-get*)