Message Boards Message Boards

1
|
2906 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Counterintuitive behavior of Remove function

Posted 11 years ago
The sequence of commands entered in one cell in the Mathematica (8.0.4.0) shell returns 1 but does not assigns any value to x:
Remove[x]; x = 1
I wonder if it is a feature which serves some purpose; a bug and Wolfram is going to fix it; or a bug and Wolfram doesn't care about it.
POSTED BY: Dmitry Podkopaev
It's a feature:
In[1]:= Remove[x]; x

Out[1]= \!\(
TagBox[
RowBox[{"Removed", "[", "\<\"x\"\>", "]"}],
False,
Editable->False]\)
See the documentation: "If you have an expression that contains a symbol which you remove, the removed symbol will be printed as Removed["name"], where its name is given in a string."
It's because you've removed the symbol from the variable list before the expression completed in evaluation.
POSTED BY: Patrick Stevens
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract