【发布时间】:2011-04-13 12:42:06
【问题描述】:
我不明白为什么我必须评估两次(在 Mathematica 7 中)才能完成作业。
第一次评估:
Unprotect[Rule];
Attributes[Rule]
pp = Plot | LogLinearPlot | ListPlot | ParametricPlot3D;
(h : pp)[True -> False] ^:= Print["Irrelevant data"]
(*
Out[2]= {SequenceHold}
During evaluation of In[1]:= UpSetDelayed::write: Tag Rule in (h:Plot|LogLinearPlot|ListPlot|ParametricPlot3D)[True->False] is Protected. >>
Out[4]= $Failed
*)
从Out[2]= {SequenceHold} 可以看出,Unprotect[Rule] 有效,但错误消息表明并非如此。如果我第二次评估该单元格,则赋值不会产生错误。
为什么会这样?
【问题讨论】: