Hacker News new | ask | show | jobs
by wodenokoto 1655 days ago
It's really hard to say in what way I don't understand something that I'm not sure I even understand.

I think one approach is to maybe fully explain the column major approach, and then introduce the row major approach, and lastly how those two interact.

> [1 2; 3 4]` is equivalent to `[1; 3;; 2; 4]`.

is a hard to understand example.

Is the space equal to ;;? e.g., is [1 2; 3 4] the same as [1;;2;3;;4]?

1 comments

The ;; is similar to the space, in that it separates elements in the second dimension. But they are not quite equivalent, because you cannot write [1;;2;3;;4]. With semicolons you have to start with the innermost dimension and work outwards. The space notation is there so that you can write the array in row-order, since that is very common.