5
$\begingroup$

These are useful function from their name.And they are kernel function since:

System`Private`HasAnyCodesQ /@ {System`Private`LookupCodeByName, 
  System`Private`LookupNameByCode}

{True, True}

But how to use them?

$\endgroup$
  • 8
    $\begingroup$ Are you really going to eventually ask about all the undocumented functions? $\endgroup$ – J. M.'s technical difficulties Jan 22 '17 at 16:53
  • $\begingroup$ @J.M. I just think they are makes sense maybe. :) $\endgroup$ – yode Jan 22 '17 at 16:54
  • 9
    $\begingroup$ They do have Private` in them... $\endgroup$ – Daniel Lichtblau Jan 22 '17 at 16:56
  • 1
    $\begingroup$ But these turn out not be that interesting. One can do the same thing with top-level functions, pretty much as efficiently as needed. I think many of the internal functions are just auxiliary functions written for other higher-level functions. $\endgroup$ – Michael E2 Jan 22 '17 at 18:59
14
$\begingroup$

I tried random inputs until I got something to work. It looks like it has to do with character codes:

System`Private`LookupNameByCode[200]
"CapitalEGrave"

And then we can plug in the reverse:

System`Private`LookupCodeByName["CapitalEGrave"]
200

Edit by yode as J.M.'s comment

Grid[DeleteCases[{#, FromCharacterCode[#], 
     System`Private`LookupNameByCode[#]} & /@ 
   Range[100, 174], {_, _, $Failed}], Frame -> All]

output

$\endgroup$
  • $\begingroup$ So, a bit like FromCharacterCode[] and ToCharacterCode[], but with the character names and not the characters themselves. $\endgroup$ – J. M.'s technical difficulties Jan 22 '17 at 16:56
  • $\begingroup$ ...and they (Lookup*) fail on ASCII characters. $\endgroup$ – Michael E2 Jan 22 '17 at 18:08
  • $\begingroup$ @MichaelE2 ... and also fail on such special characters as \! and \( etc.: System`Private`LookupNameByCode[ToCharacterCode["\!\(\)"]]. $\endgroup$ – Alexey Popkov May 17 '17 at 14:11

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