... and just as an exercise: f=:evenlink=:13 : 'x;>(y=a:){(y;<y)' NB. make a list of a boxed and double boxed version of y. take the last element if it is a:. Unbox. Treat x in the normal way. 1 f a: