Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / Programming / Assignments  /
TagSetDelayed

  • f /: lhs := rhs assigns rhs to be the delayed value of lhs, and associates the assignment with the symbol f.
  • See notes for TagSet and SetDelayed.
  • See the Mathematica book: Section 2.4.10.

    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]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.