OneTwoMany.jl
This package provides utility functions for accessing the second element, as well as the first, second and remaining elements, of iterable objects:
A function
getsecond(x): Julia provides the functionsfirstandlast, but notsecond(except forDates.second, which is about seconds in time).lastcan be used to access the second element of aTuplewith two elements or aPair, butgetsecondis clearer semantically. With tuples, it is also safer in cases where the upstream code that generates the tuple might change and generate longer tuples in the future.Two functions
first_and_restandfirst_second_restto get both the first (two) element(s) and the rest of an iterable object.Two functions
firstargandsecondargto get that simply return their first, resp. second, argument.