My version is 13.2. When debugging I came across this peculiar feature of Names
.
Starting with a fresh kernel, define
Then Names[{"context`*"}]
will search all subcontexts while Names["context`*"]
only search the first level, and the former causes unnecessary slow-down (according to the purpose).
In my experience, the later behaviour is the common one for other symbols, e.g.
Is this documented somewhere? (I read the documentation of Names
but didn't find.)
Are there any other symbols sharing similar behaviours with Names
?
Names["context`*"]
lists all symbols in the specified context", so it is a special case. $\endgroup$Names[{ctx`*}]
will search all subcontext underctx`
. I didn't find any explanation in the doc. $\endgroup$Names[{f`*}]
searches all names that match this. There is no such thing as a subcontext,f`x`x
is just a symbolx
in a contextf`x`
.Names[f`*]
would return the same but they made a special case, and documented it, that it will look inf`
only, so nof`x`
etc. $\endgroup$