This makes me wonder why the syntax for iterating over key-value pairs hasn’t been generalized to other data formats, such as custom types or array of arrays. For example:
m = [rand(10) for i in 1:10]
for (i,v) in m
#do some stuff
end
This makes me wonder why the syntax for iterating over key-value pairs hasn’t been generalized to other data formats, such as custom types or array of arrays. For example:
m = [rand(10) for i in 1:10]
for (i,v) in m
#do some stuff
end