Permutation(n) returns nothing when n > 3

This works as expected when n = 1, 2, or 3:

a = [1, 2, 3, 4, 5, 6, 7, 8]
print a.permutation(n).to_a

But when I do print a.permutation(4).to_a, nothing prints out. There’s no error, and I’ve tried a couple of other arrays, but nothing. Also,

print a.permutation.to_a

doesn’t work either, where n is effectively 8. Am I missing something simple?

I’d have to do a bit more digging if I were to confirm this, but my gut instinct is that it is a similar situation to the one I suggested here:

(I suspect the length of data that permutation returns gets quite large pretty quickly with increasing values of n).

FYI - I remember now :slight_smile:
The cause of this is indeed a limitation on the size of data being sent in an OSC packet. I discovered this a while ago as seen here (while attempting to print data derived from large folders of samples):

1 Like

Oh, right, I see. Most importantly, though, in these cases computing operations work as expected using large results that can’t be printed out to the GUI, right?

Correct. The computations themselves will work, but the last step of sending the text output to the log panel will not.

1 Like