Question

If I input a vector and wanted to flip the elements' order, I'd write

   (reverse [1 2 3])

Now, how would I generalize this idea to be able to input nested vectors and flip the order of elements? Given a matrix A the function should reverse the elements in each column.

Was it helpful?

Solution

Based on the example you gave in the comments, this is exactly what reverse does given a collection that contains collections. You want reverse.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top