Qurak

Clear my definitions

操作指南 15 步,在同一个会话中按顺序运行。每一步都在引擎上执行过,下面的输出就是它实际产生的。

第 1 步
x = 5;
y = 7;
x + y
输出
12
第 2 步
Clear[x, y]

无输出——这一步是在为下一步做准备。

第 3 步
Expand[(x + y) ^ 2]
输出
x^2 + 2*x*y + y^2
第 4 步
Clear["Global`*"]

无输出——这一步是在为下一步做准备。

第 5 步
f[x_] := Table[i, {i, 0, x}]

无输出——这一步是在为下一步做准备。

第 6 步
f[{2, 4, 5, 6}]
输出
Table[i, {i, 0, {2, 4, 5, 6}}]
第 7 步
SetAttributes[f, Listable]
f[{2, 4, 5, 6}]
输出
{{0, 1, 2}, {0, 1, 2, 3, 4}, {0, 1, 2, 3, 4, 5}, {0, 1, 2, 3, 4, 5, 6}}
第 8 步
Clear[f]
 ? f
输出
InformationData[<|ObjectType -> Symbol, Usage -> Global`f, Documentation -> None, OwnValues -> None, UpValues -> None, DownValues -> None, SubValues -> None, DefaultValues -> None, NValues -> None, FormatValues -> None, Options -> None, Attributes -> {Listable}, FullName -> Global`f|>]
第 9 步
ClearAll[f]
 ? f
输出
Missing[UnknownSymbol, f]
第 10 步
f[x_] := Table[i, {i, 0, x}]
SetAttributes[f, Listable]
 ? f
输出
InformationData[<|ObjectType -> Symbol, Usage -> Global`f, Documentation -> None, OwnValues -> None, UpValues -> None, DownValues -> Information`InformationValueForm[DownValues, f, {f[x_] :> Table[i, {i, 0, x}]}], SubValues -> None, DefaultValues -> None, NValues -> None, FormatValues -> None, Options -> None, Attributes -> {Listable}, FullName -> Global`f|>]
第 11 步
ClearAttributes[f, Listable]
 ? f
输出
InformationData[<|ObjectType -> Symbol, Usage -> Global`f, Documentation -> None, OwnValues -> None, UpValues -> None, DownValues -> Information`InformationValueForm[DownValues, f, {f[x_] :> Table[i, {i, 0, x}]}], SubValues -> None, DefaultValues -> None, NValues -> None, FormatValues -> None, Options -> None, Attributes -> {}, FullName -> Global`f|>]
第 12 步
x = 5
输出
5
第 13 步
x=.
 ? x
输出
Missing[UnknownSymbol, x]
第 14 步
Remove[x]
 ? x
输出
Missing[UnknownSymbol, x]
第 15 步
x
 ? x
输出
Missing[UnknownSymbol, x]

用到的函数

相关操作示例

全部操作示例 · 函数参考 · 从 MCP 客户端使用