Idiomatically determine all the characters that can be used for symbols: Difference between revisions
Content added Content deleted
(Added Quackery) |
|||
Line 328: | Line 328: | ||
Kotlin Identifier ignorable: [0][1][2][3][4][5][6][7][8][14][15][16][17][18][19][20][21][22][23][24][25][26][27][127][128]... |
Kotlin Identifier ignorable: [0][1][2][3][4][5][6][7][8][14][15][16][17][18][19][20][21][22][23][24][25][26][27][127][128]... |
||
</pre> |
</pre> |
||
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
|||
<lang Mathematica>chars = Characters[FromCharacterCode[Range[0, 1114111]]]; |
|||
out = Reap[Do[ |
|||
If[Quiet[Length[Symbol[c]] == 0], |
|||
Sow[c] |
|||
] |
|||
, |
|||
{c, chars} |
|||
]][[2, 1]]; |
|||
Print["Possible 1st characters: ", out // Length] |
|||
out = Reap[Do[ |
|||
If[Quiet[Length[Symbol["a" <> c]] == 0], |
|||
Sow[c] |
|||
] |
|||
, |
|||
{c, chars} |
|||
]][[2, 1]]; |
|||
Print["Possible 2nd-nth characters: ", out // Length]</lang> |
|||
{{out}} |
|||
In Wolfram Language almost all characters (there are 1114112 characters defined) can be used in variable/function names. I can't show all valid characters as there are over a million that are allowed. I do not show the list of characters 'out' but rather their length for practical purposes: |
|||
<pre>Possible 1st characters: 1113704 |
|||
Possible 2nd-nth characters: 1113726</pre> |
|||
=={{header|Nim}}== |
=={{header|Nim}}== |