max (pvb -w max, vb list, cmp compare)                                           
{
  vb slice = alloc (&_, T_SLICE, list, ALLOW_EMPTY);

  vb current = alloc (&_, T_LINK);

  for (i = 0; i < length; i ++)
  {
    detach (current, slice, REDUCE_SLICE), { reset_link (current) };

    if (!*max)
    { 
      move_link (*max, current), { *max = alloc (&_, T_LINK) };
    }
    else
    {
      if (compare (*max, current) == CR_LT)     
      {
        move_link (*max, current), { reset_link (*max) };
      }
      else
      {
        ;
      }
    }
  },
  {
    length = _ (slice)     
  }
}
/
{
  free (&current, &slice);
}
