2

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:

  1. 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 substituted CombineAt=SubsetMap in 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.
  2. Linguistic: The respective, linguistic operator form "I'm going to use f to CombineAt pos in expr seems more active than the more passive (and awkward) "I'm going to SubsetMap f at pos in expr.
  3. Generality: CombineAt captures the function's full generality since it indicates operate on any expression at any position. Contrast this with the family of Subset functions SubsetCases, SubsetPosition, SubsetReplace, SubsetCount (that it is clearly being linked to) that only operate on lists.
  4. Avoids inconsistency and misleading connections: The whole point of the Subset* functions is that order is not important as they distinguish from ordered analogies SequenceCases, SequencePosition, SequenceReplace, SequenceCount. In contrast, there is no notion of orderlessness in SubsetMap since positions are explicitly specified (not to mention no "SequenceMap" analogue). Further, Map has a specific meaning in the WL that seems to have no bearing on its more mathematical use in this function.
  5. Consistency: CombineAt seems much more closely related to MapAt's functionality (while ParallelCombine supports the specification of a "combining" function).

So my question is this: what are the reasons for the SubsetMap name?

Ronald Monson
  • 6,076
  • 26
  • 46
  • Indeed, something with an At at 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:09
  • Well that is (only) part of the purpose of this question. The availability of a "language-design" tag suggests to me that it is fair game to seek reasons "for" the original naming (that I could well have overlooked). Actually I did suggest this prior to V12.1's release (when it was tagged experimental) and am curious about naming in general and the community's take. – Ronald Monson Mar 21 '20 at 10:25
  • I know from watching the livestreams that WRI anguished over the naming of SubsetMap. Personally, I liked ApplyAt (as the best of a bad bunch). SubsetMap does not really fit in with the other new subset functions SubsetReplace, SubsetCases, SubsetCount, etc. – WReach Mar 30 '20 at 17:02
  • @WReach I wasn't aware of the livestream - do you have the episode by any chance? I agree that SubsetMap seems 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->SubsetMap being one of the few. ApplyAt while containing the more apt "At", similarly suffers because of the specific history/meaning of Apply which confuses the generic meaning with WL's explicitness. The combine in CombineAt otoh doesn't have this baggage with the combine also capturing its "in-placeness". – Ronald Monson Mar 30 '20 at 21:43
  • @RonaldMonson I took a quick look through the livestreams list, but I was not able to locate one of the relevant episodes. My recollection is that there were several discussions about it right before the 12.0 release... so late 2018/early 2019. In one episode the discussion was quite long with many suggestions given in the stream chat on Twitch. Sorry I can't be more specific, but there are a lot of recorded videos and I know no easy way to scan their content. I think it would have been one of the "Language Design" sessions. – WReach Mar 30 '20 at 23:09
  • @WReach Ok, thanks, no worries; Apparently there are some WL functions/APIs that can be used to search this archive - don't have time right now but perhaps will road-test these with this particular example. – Ronald Monson Mar 30 '20 at 23:24

0 Answers0