I am trying to get used to fixed arrays for backing buffers, but I feel like I am missing a trick. Often I want to do
for do buf[n++] = my_read(&reader) or_break
where n is the current number of active elements in the buffer buf. But since n++ is not allowed in Odin, I have to write
for {
buf[n] = my_read(&reader) or_break
n += 1
}
which feels like many lines in comparison. Is there a better way to work with fixed arrays as buffers?