How to nest any number of for loops

The Base.Cartesian.@nloops macro constructs such things.
Take a look at Base.Cartesian · The Julia Language

1 Like