Paste: cache-get (locals style)

Author: dharmatech
Mode: factor
Date: Tue, 14 Oct 2008 07:11:07
Plain Text |
:: cache-get ( OBJ -- rrs/f )
   [let | ENT [ OBJ cache-at ] |
     {
       { [ ENT f =      ] [                  f ] }
       { [ ENT expired? ] [ OBJ cache-delete f ] }
       {
         [ t ]
         [
           [let | NAME  [ OBJ name>>       ]
                  TYPE  [ OBJ type>>       ]
                  CLASS [ OBJ class>>      ]
                  TTL   [ now ENT time>> - ] |
             ENT data>>
               [| RDATA | T{ rr f NAME TYPE CLASS TTL RDATA } ]
             map
           ]
         ]
       }
     }
     cond
   ] ;

New Annotation

Summary:
Author:
Mode:
Body: