The solution is quite simple. The trick is to use LaTeX style syntax as in the documentation of @nloops:
@nloops(3, i, d -> (d < 3) ? range(1,i_{d+1}) : (1:3), begin display(@ntuple 3 i) end)
The solution is quite simple. The trick is to use LaTeX style syntax as in the documentation of @nloops:
@nloops(3, i, d -> (d < 3) ? range(1,i_{d+1}) : (1:3), begin display(@ntuple 3 i) end)