Closed
Description
When I want to iterate over all the members of a type the first valid syntax that comes to mind is roughly:
members = names(thing)
for name in members
...
end
But this might be pretty inefficient (I only looked deep enough to see a call to collect
, I'm assuming it's creating a new array each time).
Maybe this has been discussed before, but wouldn't it be nice if I could:
for (name, value) in thing # <--- treat the type like a dictionary
...
end
and count on things in the background to not allocate an array?
Metadata
Assignees
Labels
No labels
Activity