Message Boards Message Boards

0
|
2967 Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

List all built-in commands and symbols of Mathematica programtically

Posted 2 years ago

Currently, I want to enhance the emacs mode for Wolfram Language packge written by xahlee. Basically, I want to obtain the following information from within Mathematica programtically:

  1. List of all built-in commands. For each of them, return a concise the description of the usage in combination with the input method of form parameters.

  2. List of all built-in symbols. By symbols, I mean, for example, the mathematical symbols and so on. For each of them, return a concise the description of its full form used for inputting, meaning, alias, and the Unicode point value.

Any hints for achieving this aim will be highly appreciated.

Regards, HZ

POSTED BY: Hongyi Zhao
5 Replies
Posted 2 years ago

I tried the following command:

allSymbols = WolframLanguageData[];

But still can't find something like the following in the output:

\[Alpha]

BTW, how to search all entries which including a substring expressed by a specific regular expression from the above output?

Regards, HZ

POSTED BY: Hongyi Zhao
Posted 2 years ago

That is because \[Alpha] is not a symbol, it is a named character. Programatically (from here)

Select[Table[{#, ToString[FullForm[#]]} &[FromCharacterCode[i]], {i, 65535}], StringMatchQ[#[[2]], "\"\\[" ~~ __] &]

search all entries which including a substring expressed by a specific regular expression from the above output

All symbol names with 4 uppercase characters

allSymbols // Select[StringMatchQ[CanonicalName@#, RegularExpression["([A-Z].+){4}"]] &] 
POSTED BY: Rohit Namjoshi
Posted 2 years ago
  1. But I still can't figure out how to enumerate each command and symbol as a parameter and feed it to WolframLanguageData.
  2. But there is no official Wolfram LSP client for Emacs.
POSTED BY: Hongyi Zhao
Posted 2 years ago

But I still can't figure out how to enumerate each command and symbol as a parameter and feed it to WolframLanguageData.

The first example in the Details section

WolframLanguageData[] gives a list of all Wolfram Language symbols.

allSymbols = WolframLanguageData[];
AssociationMap[#["DocumentationBasicExamples"] &, RandomSample[allSymbols, 5]]

But there is no official Wolfram LSP client for Emacs.

Right. Emacs does support LSP so you could write one using the existing languages Emacs supports and the official ones for Visual Studio and Sublime as examples.

POSTED BY: Rohit Namjoshi
Posted 2 years ago

Hi Hongyi,

Take a look at WolframLanguageData.

It's been a while since I did emacs programming, if it supports LSP now then take a look at this

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract