add along_index, like function_index but for along
add erase(a, i, dim) that uses along_index