Re: Counting the total number of available Mathematica commands ?
- To: mathgroup at smc.vnet.net
- Subject: [mg22896] Re: Counting the total number of available Mathematica commands ?
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Tue, 4 Apr 2000 22:41:01 -0400 (EDT)
- References: <8c69iv$51t@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
This thread has raised some interesting issues.
Re: David's posting
Names["*"] will give all names in contexts on the current context path,
given by $ContextPath (at start up I get {"Global`", "System`"} ). it will
give only their short names, "Plot" instead of the long name "System`Plot".
Names[] will give the names in all the current contexts given by Context[]
whether or not they are on the current context path. It will give short
names for those on the current context path and long name for the others.
Re: Jens's posting
With
nlist = Names["*"];
optandfun =
First /@ Select[{#, ToExpression[#]} & /@ nlist,
First[#] == ToString[Last[#]] &];
we find that the new symbol nlist is included:
MemberQ[nlist, "nlist"]
True
And (with needed parentheses added)
onlyopt =
ToString /@ (Flatten[
Options[ToExpression[#]] & /@ optandfun] /. {Rule[a_, b_] :>
a,
Verbatim[RuleDelayed][a_, b_] :> a});
includes "$Failed", which is not an option.
Check:
MemberQ[onlyopt, "$Failed"]
True
This seems to be due to
Options /@ {BoxData, TextData}
{{$Failed}, {$Failed}}
As Jens mentions, there is a problem with options buried in option values,
like FontFamily and FontColor in
TextStyle -> {FontFamily -> Times, FontColor -> Hue[0]}
The following seems to deal with these two points
onlyopt2 =
ToString /@
Union[Cases[
Flatten[Options[ToExpression[#]] & /@
optandfun], ( Rule | RuleDelayed)[a_, _] -> a, Infinity]];
We can compare sizes
Length[Union[onlyopt]]
437
Length[onlyopt2]
485
However, as Jens points out, we still have the issue of what a function is.
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565