How can I get every other item of a list (Or every 3rd, 4th, etc.)?
Up to every 10th item can be gotten very easily, with the help of step().
&every_other foo=%1 think step(foo/every_other, a b c d e f, 2) => b d f
If you want every other element starting with the first, use
%0 instead of %1.
Alternatively, you can use elements() and build the list of
positions using lnum() and vmul().
think elements(a b c d e f, vmul(lnum(0, 6), 2))
2001-Nov-13 6:44pm shawnw