$ContextAliases
is a global variable that gives an association with mappings from aliases to contexts.
Details
- $ContextAliases takes the form <"alias1`""context1`","alias2`""context2`",… >, where aliasi can be any string of characters that could be used to create a legal symbol name. contexti must be a fully qualified context name.
- An alias can be used in place of a fully qualified context when referring to symbols. For a given symbol context`symbol, the name alias`symbol may be used in its place.
- $ContextAliases can be modified directly. It is also updated automatically by calls to Needs, EndPackage and End. »
Examples
open allclose allBasic Examples (1)
Scope (8)
Creating Context Aliases (4)
$ContextAliases must be an association with entries of the form "alias""context`":
Aliases cannot represent relative contexts:
Aliases must form legal symbol names:
Needs can create a context alias:
Use PackedArrayQ from the Developer Utilities Package:
Since "Developer`" is not on $ContextPath, the unqualified symbol name is not resolved:
Properties & Relations (9)
Context aliases work in ToExpression:
A context alias is resolved in held evaluations:
Symbol resolves context aliases:
Changes made to aliases after BeginPackage will be restored after the matching EndPackage:
End restores $ContextAliases to the value it had before the matching Begin:
Names resolves context aliases by default:
Use the ResolveContextAliases option to prevent alias resolution:
NameQ behaves identically:
Contexts resolves aliases by default:
Use the ResolveContextAliases option to prevent alias resolution:
Information resolves aliases by default:
Information also uses aliases when resolving string patterns:
Use the ResolveContextAliases option to prevent alias resolution:
An active alias cannot be added to $ContextPath:
Text
Wolfram Research (2021), $ContextAliases, Wolfram Language function, https://reference.wolfram.com/language/ref/$ContextAliases.html.
CMS
Wolfram Language. 2021. "$ContextAliases." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$ContextAliases.html.
APA
Wolfram Language. (2021). $ContextAliases. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$ContextAliases.html