I'm a big fan of the functionality introduced by SubsetMap but am puzzled as to why it was not called "CombineAt". There are multiple reasons:
- Indicative: Combining the elements of a given expression at given positions seems to capture what it does more so than the apparently more obscure
SubsetMap(initially I could never remember the function's name until I substitutedCombineAt=SubsetMapin my initialisation). It seems to capture the "in place" transformation by connoting the fact that the supplied function needs to return a list with the same length as the positions specified. - Linguistic: The respective, linguistic operator form "I'm going to use f to
CombineAtpos in expr seems more active than the more passive (and awkward) "I'm going toSubsetMapf at pos in expr. - Generality:
CombineAtcaptures the function's full generality since it indicates operate on any expression at any position. Contrast this with the family ofSubsetfunctionsSubsetCases,SubsetPosition,SubsetReplace,SubsetCount(that it is clearly being linked to) that only operate on lists. - Avoids inconsistency and misleading connections: The whole point of the
Subset*functions is that order is not important as they distinguish from ordered analogiesSequenceCases,SequencePosition,SequenceReplace,SequenceCount. In contrast, there is no notion of orderlessness inSubsetMapsince positions are explicitly specified (not to mention no "SequenceMap" analogue). Further,Maphas a specific meaning in the WL that seems to have no bearing on its more mathematical use in this function. - Consistency:
CombineAtseems much more closely related toMapAt's functionality (whileParallelCombinesupports the specification of a "combining" function).
So my question is this: what are the reasons for the SubsetMap name?
Atat the end might have been more meaningful. Well, I am pretty sure that I know who picked this name and that this person does not roam these rooms. So I do not really understand the purpose of this question. If you mean to suggest a renaming then you should better contact support. – Henrik Schumacher Mar 21 '20 at 10:09SubsetMap. Personally, I likedApplyAt(as the best of a bad bunch).SubsetMapdoes not really fit in with the other new subset functionsSubsetReplace,SubsetCases,SubsetCount, etc. – WReach Mar 30 '20 at 17:02SubsetMapseems oddly out of place with the new subset functions and this is tacitly acknowledged if you look at the "See Also" linkages in the Help Documentation:SubsetReplace->SubsetMapbeing one of the few.ApplyAtwhile containing the more apt "At", similarly suffers because of the specific history/meaning ofApplywhich confuses the generic meaning with WL's explicitness. The combine inCombineAtotoh doesn't have this baggage with the combine also capturing its "in-placeness". – Ronald Monson Mar 30 '20 at 21:43