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 1999

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

Search the Archive

Re: function arguments as subscripts

  • To: mathgroup at
  • Subject: [mg19151] Re: function arguments as subscripts
  • From: Bruno Daniel <bruno.daniel at>
  • Date: Thu, 5 Aug 1999 23:58:52 -0400
  • Organization: University of Karlsruhe
  • References: <7obcis$>
  • Sender: owner-wri-mathgroup at

Hi Henrik

> In[16]:=
>    \!\(foo\_\(k_, l_\) = k l\)

The FullForm of this is:

(You can get this by wrapping the expression with

Now it's apparent that you should define an upvalue for foo rather
than a downvalue for Subscript. So in order to define it in a
package, just insert a ^ in front of  "=" or ":=" or  put   "foo /:" in front of
the definition:

\!\(foo\_\(k_, l_\) ^= kl\)
\!\(foo\  /: \ \ foo\_\(k_, l_\) = kl\)

You can then check the definition by issuing ??foo:


"Global`foo"             (* or whatever package you choose *)
Subscript[foo, k_, l_] ^= kl

You can then set the usage string of foo:
foo::usage = "xxx"


Subscript[foo, k_, l_] ^= kl

Yours sincerely

  • Prev by Date: Re: How can I do this?
  • Next by Date: Re: Can someone explain this?
  • Previous by thread: function arguments as subscripts
  • Next by thread: Can someone explain this?