1
$\begingroup$

I am reading "Mathematics and Algorithms" as part of the Wolfram Tutorial series.

In "Values for symbols" section of the "Algebraic Calculations" chapter it is described that =. can be used to clear the contents of a variable.

I am struggling to be able to understand in which cases this is applicable.

For example, I have a notebook which I have been using for several tests and specifically I can not clear the value of x.

 In[] x
Out[] Removed[t]
 
 In[] x=.
Out[]

 In[] x
Out[] Removed[t]

Why x is not being cleared?

$\endgroup$
3
  • 4
    $\begingroup$ Please include relevant previous steps of your calculation that lead to this behavior. Example 1: If I Quit[] to get a fresh kernel, then use x=t;Remove[t];x I get Removed[t] like you, but then x=.;x gives x so the variable is cleared as expected. Example 2: If I Quit[] to get a fresh kernel, then use x=t;x/:Unset[x]=Null;Remove[t]; then afterwards I see the same behavior as you. Example 2 is contrived, and just to illustrate that this behavior is possible, but I wonder what you did. $\endgroup$
    – user293787
    Commented Aug 20, 2022 at 7:45
  • 1
    $\begingroup$ I do not know the relevant previous steps as I was reusing over and over the same notebook to follow a course. But it is good to know that with Quit[] I get a fresh kernel. If I ever identify what is generating this issue I will repost the path that lead to this behaviour. My expectation was that =. shall clear the symbol/variable always. $\endgroup$
    – M.E.
    Commented Aug 20, 2022 at 8:27
  • $\begingroup$ I almost always use ClearAll[x] instead. $\endgroup$
    – Somos
    Commented Aug 20, 2022 at 22:55

0