@inno The whole paradigm of components being “one-to-one”, “one-to-many”, or “many to one” (as presented in Andrew Heumann’s “The Deal with Data Trees”) is incomplete, and not universally applicable. At best, we could consider these mappings between pairs of inputs and outputs of a component, and then still you’d have to consider mappings such as “many-to-many”… or “fewer”, or “more”.
The same is true of the paradigm regarding how input matching is done. While generally speaking it is true, that the items of a list are matched by index, and, that a list of insufficient length is expanded by the repetition of the last index to meet the list length of the longest list involved in a method (longest-list, repeat last input matching), it is not true across the board. Dispatch for instance, either expands the Dispatch Pattern list by repetition or truncates the list to match the List input list length. The pattern of Pick’n’Choose, then, on the other hand, truncates the Stream lists to the list length of the Pattern. None of this is consistent.
All of which is to say that design decisions made by David in the development of Grasshopper at some point became “holistic”, or context-based.
Is Join Curves a “one-to-many” component? Well, from the viewpoint of the Preserve input… yes. From one bool, you can get multiple joined geometries. The input matching of components using a bool to influence how a component executes function breaks the input matching paradigm generally. Like, if I give Join Curves a list of curves and list of bools, it’s not going to match a bool to a curve by index, rather it will apply a bool to an entire list of curves. Ostensibly, Join Curves forceably grafts a list of Preserve bools before using it.
Is Join Curves a “one-to-many” component in the sense that a set of input values can be mapped to different output outcomes? No… but yes. Consider this set of curves of bools given to Join Curves,:
a set of lines arranged in a rectangle and set of bools “True, False, True”. Could you tell me the resulting number of curves and to which bool the resulting curves belong?
The answer is “no”. You’d have to know the direction of the lines in the rectangle. So while this specific set of inputs can only lead to one geometric result (one-to-one mapping), on the basis of the number of curves and booleans provided ALONE, multiple results are possible. Which is what necessitates the grafting of an additional depth of hierarchy ({…;+n}).