Mathematica 9 is now available
Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Displaying Mathematica's Global rules

  • To: mathgroup at
  • Subject: [mg32070] Re: Displaying Mathematica's Global rules
  • From: atelesforos at (Orestis Vantzos)
  • Date: Sat, 22 Dec 2001 04:22:41 -0500 (EST)
  • References: <9vs8m3$g1a$>
  • Sender: owner-wri-mathgroup at

Repeat after me: FullForm is my best friend, FullForm is my best
--> Subscript[d,a_,b_]
Subscript[d,a_,b_]:=If[a==b,1,0] (which is a way to define the
Kronecker delta for 2 indices) is a rule about function Subscript with
first argument d!
Mathematica automaticaly stores the rule in the Downvalues of
Subscript and ?Subscript will show it.
Now, how do I store it with d?
Well, you have to persuade Mathematica to store it in the Upvalues of
d. This will suffice:
d     ^:=If[a==b,1,0]  or even d/:d     :=If[a==b,1,0]
 a_,b_                            a_,b_
will do.
Global` is a Context of Symbols and has nothing to do with the
Now go read about Contexts(and Downvalues and Upvalues) in the Mathematica Book :-)

  • Prev by Date: Re: Replacement Rule
  • Next by Date: RE: Replacement Rule
  • Previous by thread: Re: Displaying Mathematica's Global rules
  • Next by thread: Re: Displaying Mathematica's Global rules