4
$\begingroup$

I cannot find any reference to the $ in the Mathematica documentation, yet I frequently see it used, especially on StackExchange.

$\endgroup$
0

2 Answers 2

6
$\begingroup$

It has no built-in meaning, you are free to assign it a value:

In[23]:= $ = 3

Out[23]= 3

It is common to name package constants with a symbol starting with $, but this is just a convention.

$\endgroup$
1
  • 4
    $\begingroup$ I think "constant" is not quite the best word for it. I'd rather say "global variables that are not supposed to be messed with by the user". E.g., $ContextPath is meant to be change frequently -- alas only by the system, not by the user. $\endgroup$ Nov 9, 2022 at 10:47
4
$\begingroup$

It has no inherent meaning, but it is used by convention as a prefix for many system parameters and special-purpose symbols. Look at

Names["System`$*"]

It is also used to "localize" variables in Module. Look at

Module[{x}, x]
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.