next, prev, xprev¶
Immediate or near neighbors
What if just under this layer of life you could
find the old one, moving forward just the same,
and just above, what’s yet to come
— Emily Berry, Unexhausted Time
next¶
Next item/s in a list
next x next[x]
Where x is a list, for each item in x, returns the next item.
For the last item, it returns a null if the list is a vector, otherwise an empty list ().
Duration of a quote:
next is a uniform function.
prev¶
Immediately preceding item/s in a list
prev x prev[x]
Where x is a list, for each item, returns the previous item.
For the first item, it returns a null if the list is vector, otherwise an empty list ().
Shift the times in a table:
prev is a uniform function.
xprev¶
Nearby items in a list
x xprev y xprev[x;y]
Where x is a long atom and y is a list, returns for each item of y the item x indices before it.
The first x items of the result are null, empty or blank as appropriate.
There is no xnext function.
Fortunately xprev with a negative number on the left can achieve this.
xprev is a right-uniform function.