1
$\begingroup$

Internal`ArgumentCountRegistry sometimes will give a value about some function.Such as

Internal`ArgumentCountRegistry /@ {DisjointQ, Autocomplete, 
  AssociationMap, CountDistinct, CountDistinct, CountDistinctBy, 
  Decapitalize, DeleteDuplicatesBy, DeleteMissing, DeleteSearchIndex, 
  IntersectingQ, LanguageIdentify, NetModel, NetReplacePart}

{{1,2},{1,3},{1,2},{1,2},{1,2},{1,2},{1,1},{1,2},{1,3},{1,1},{1,2},{1,1},{1,2},{2,2}}

But what's meaning of this result?

$\endgroup$
  • $\begingroup$ I'm gonna guess it's how many are required and what the max number is or something along those lines. $\endgroup$ – b3m2a1 Mar 16 '17 at 5:30
5
$\begingroup$

So I put this in a comment but now I'm relatively more sure. I think the first number is how the minimum number of arguments allowed and the right is the maximum. I'm guessing this is in some way input by the devs because it hasn't been updated for 11. Here's how I know. I ran this:

mapped =
  DeleteCases[
   AssociationMap[
    If[Length@ToExpression[#, StandardForm, OwnValues] == 0 && 
       MatchQ[ToExpression@#, _Symbol],
      Internal`ArgumentCountRegistry@ToExpression@#,
      Nothing
      ] &,
    Names[]
    ],
   Nothing
   ];

Select[
 mapped,
 MatchQ[Except[_Internal`ArgumentCountRegistry]]
 ]

And it spat out a big association of stuff:

<|"GeneralUtilities`AppendAt" -> {3, 3}, 
 "GeneralUtilities`AppendToAt" -> {3, 3}, 
 "GeneralUtilities`AssociatePairs" -> {1, 1}, 
 "AssociationMap" -> {1, 2}, 
 "GeneralUtilities`AssociationPairs" -> {1, 1}, 
 "Autocomplete" -> {1, 3}, 
 "GeneralUtilities`BlockProtected" -> {2, 2}, 
 "GeneralUtilities`CacheTo" -> {3, 3}, "CountDistinct" -> {1, 2}, 
 "CountDistinctBy" -> {1, 2}, "Decapitalize" -> {1, 1}, 
 "GeneralUtilities`DeepCases" -> {1, 2}, 
 "GeneralUtilities`DeepUniqueCases" -> {1, 2}, 
 "DeleteDuplicatesBy" -> {1, 2}, "DeleteMissing" -> {1, 3}, 
 "DeleteSearchIndex" -> {1, 1}, "DisjointQ" -> {1, 2}, 
 "GeneralUtilities`FirstMatchIndex" -> {1, 3}, 
 "GeneralUtilities`FlatMap" -> {1, 2}, 
 "GeneralUtilities`FoldEmit" -> {3, 3}, 
 "GeneralUtilities`FoldEmitRecurse" -> {3, 3}, 
 "GeneralUtilities`FoldRecurse" -> {3, 3}, 
 "GeneralUtilities`IndexBy" -> {1, 2}, 
 "GeneralUtilities`IndexOf" -> {1, 3}, 
 "GeneralUtilities`IndicesOf" -> {1, 2}, "IntersectingQ" -> {1, 2}, 
 "GeneralUtilities`JoinMap" -> {1, 2}, 
 "GeneralUtilities`MapIf" -> {2, 3}, 
 "GeneralUtilities`MapSequence" -> {1, \[Infinity]}, 
 "GeneralUtilities`MatchIndices" -> {1, 2}, 
 "GeneralUtilities`PairQ" -> {1, 1}, 
 "GeneralUtilities`PosetSort" -> {2, 2}, "PowerRange" -> {1, 3}, 
 "PrintableASCIIQ" -> {1, 1}, 
 "GeneralUtilities`PropertyAssociation" -> {1, 1}, 
 "GeneralUtilities`ReapBag" -> {1, 1}, 
 "GeneralUtilities`ScanIndexed" -> {1, 3}, 
 "GeneralUtilities`ScanThread" -> {1, 2}, "SearchIndices" -> {0, 0}, 
 "GeneralUtilities`SelectFirstIndex" -> {1, 3}, 
 "GeneralUtilities`SelectIndices" -> {1, 2}, "Snippet" -> {1, 2}, 
 "GeneralUtilities`SowBag" -> {1, 1}, 
 "StringExtract" -> {2, \[Infinity]}, "StringPadLeft" -> {1, 3}, 
 "StringPadRight" -> {1, 3}, 
 "GeneralUtilities`StringPatternQ" -> {1, 1}, 
 "StringRepeat" -> {2, 3}, "StringRiffle" -> {2, \[Infinity]}, 
 "SubsetQ" -> {1, 2}, "TextSearch" -> {2, 2}, 
 "TextSearchReport" -> {2, 2}, "TextString" -> {1, 1}, 
 "GeneralUtilities`ToAssociations" -> {1, 1}, 
 "GeneralUtilities`ToCamelCase" -> {1, 1}, 
 "GeneralUtilities`ToTitleCase" -> {1, 1}, 
 "GeneralUtilities`TransposeTo" -> {1, 2}, 
 "GeneralUtilities`TrimLeft" -> {1, 1}, 
 "GeneralUtilities`TrimRight" -> {1, 1}, 
 "GeneralUtilities`UniqueCases" -> {1, 2}, 
 "UpdateSearchIndex" -> {1, 1}|>

And I checked all the non GeneralUtilities` stuff in the docs and checked some of the GU stuff from the DownValues and it mostly works out. All is correct except for TextSearch, but I can't find the v10 docs for TextSearch to see if there's been a change in the allowed arguments. On the other hand, everything I found there was added in 10.x which suggests that no updates were done for the new in 11. stuff.

It's curious, but it seems to make sense. Of course I could also be flat-out wrong. Just speculating here.

$\endgroup$
  • $\begingroup$ Little strange,you mean DisjointQ can accept on argument? $\endgroup$ – yode Mar 16 '17 at 6:06
  • $\begingroup$ Yep. Check out DisjointQ[{1, 2, 3}]@{1, 2, 3}. It can clearly behave as an operator. $\endgroup$ – b3m2a1 Mar 16 '17 at 6:07
  • $\begingroup$ Well,I don't know this usage of DisjointQ before this.. $\endgroup$ – yode Mar 16 '17 at 6:09
  • $\begingroup$ @yode It's says that they're not disjoint, which I think counts as working. The SyntaxInformation suggests it can't, but clearly it can. $\endgroup$ – b3m2a1 Mar 16 '17 at 6:10
  • 1
    $\begingroup$ @yode I'm gonna guess they had it in for some beta version or something, then deprecated it by making it undocumented. A similar thing happened to InlinePart $\endgroup$ – b3m2a1 Mar 16 '17 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.