Filling Array2D Error

I am trying to use the Array2D for the first time. I thought using it should be as easy as

Array2D.fill(4, {0})

But this gives the following Error:

ERROR: 'add' should have been implemented by Array2D.
RECEIVER: Array2D[ [ nil ][ nil ][ nil ][ nil ] ]

yep .fill is not implemented for Array2D…

I’d suggest an array of arrays:

for a 4 x 4 artray of zeros:


or even:

0 ! [4,4]

access like ~myArray[x][y]

see J concepts in SC | SuperCollider 3.12.2 Help for more