Idea

Mischa Spelt avatar image
1 Like"
Mischa Spelt suggested Matt Long edited

Array overload of model.find?

Low-priority idea, but I often find myself writing code like

Array objects = [model.find("Processor1"), model.find("Processor2"), model.find("Processor3")]

and saw similar code in other places like the training slides. Perhaps it would be cool if we can shorten this to

Array objects = model.find(["Processor1", "Processor2", "Processor3"])

I mean, all it needs is an overload for treenode.find that accepts an array variant and converts find of an array into the equivalent array of finds (even error handling can be delegated, if you convert model.find(["a", 1]) into [model.find("a"), model.find(1)] it'll automatically complain about an error in the second element, I guess).

arraydot syntaxtreenode.find
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Comment

Matt Long avatar image
0 Likes"
Matt Long commented Matt Long edited

This seems like a pretty good idea, though I think we'd just make a new method like findMany or something..

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.