Now that I think of it, wouldn't it make sense to have this mechanism for matrix operations in general (for Julia, that is)?
You'd need immutable matrices. Only evaluate the operations when a result is indexed, using some kind of linear operation interpreter works iteratively without allocating temporary results where it makes sense (addition, substraction, transposition, scalar operations, maybe others)?
proposed syntax:
immutable_matrix = [| 1, 2 |
| 3, 4 |]
inline = [| 1, 2 | | 3, 4 |]
The use of the pipe is not ambiguous (bracket-pipe and value-pipe-space-pipe-value are not valid at the moment), and, by using comas, you don't have the pitfalls of significant white space as with hcat.
They could coexist for a while with their mutable cousins before they're deprecated.
I've seen the immutable Transpose proposition, but if the underlying
Also:
threedee = [|| 1, 2 | | 5, 6 ||
|| 3, 4 | | 7, 8 ||]
fourdee = [||| 1, 2 | | 5, 6 ||
|| 3, 4 | | 7, 8 |||
||| a, b | | e, f ||
|| c, d | | g, h |||]
:-)