Method code for $list.chop()

[Turn off line numbering]
  1: arg list, @count;
  2: 
  3: // chops the last <count> elements off the list.
  4: // return [] if count is longer then the list.
  5: count = count || 1;
  6: anticipate_assignment();
  7: return (| sublist(list, 1, listlen(list) - count) |) || [];

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon