julia> s = 0
for i1=1:4, i2=1:4, i3=1:4, i4=1:4
s += i1 + i2 + i3 + i4
end
s
2560
julia> s = 0
for i1 in 1:4,
i2 in 1:4,
i3 in 1:4,
i4 in 1:4
s += i1 + i2 + i3 + i4
end
s
2560
If you need even more power (i.e., do this nested loop over an array of ranges instead of a fixed number of them) you probably can use Combinatorics.jl.