TagSetDelayed
Usage
• f/: lhs := rhs 将 rhs 赋为lhs的延迟值,并对符号 f 关联这个赋值。
Notes
Further Examples
Nothing is done here.
In[1]:=
|
Out[1]=
|
This defines a rule for the product of Sin and Cos and associates that rule with the Sin function. Sin has to be unprotected first.
In[2]:=
|
Out[2]=
|
By storing the rule with Sin instead of the top level operation Times, you avoid slowing down every computation with Times.
In[3]:=
|
In[4]:=
|
Out[4]=
|
We restore the original behavior of Sin. Clear does not get rid of the built-in definitions for Sin.
In[5]:=
|
In[6]:=
|
Out[6]=
|
In[7]:=
|
Out[7]=
|
|