up

A priority search queue and LRU cache.
git clone git://git.jtobin.io/up.git
Log | Files | Refs

up_qor_size.c (435B)


      1 #include "all.h"
      2 
      3 u3_atom
      4 u3qdu_qor_size(u3_noun t)
      5 {
      6   if ( u3_nul == t ) {
      7     return 0;
      8   }
      9   else {
     10     u3_atom pro = u3k(u3h(u3t(t)));
     11 
     12     if ( c3n == u3ud(pro) ) {
     13       return u3m_bail(c3__exit);
     14     }
     15     else {
     16       return pro;
     17     }
     18   }
     19 }
     20 
     21 u3_noun
     22 u3wdu_qor_size(u3_noun cor)
     23 {
     24   u3_noun t;
     25 
     26   if ( (c3n == u3r_mean(cor, u3x_sam, &t, 0)) )
     27   {
     28     return u3m_bail(c3__exit);
     29   } else {
     30     return u3qdu_qor_size(t);
     31   }
     32 }
     33