MathGroup Archive 2010

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

Search the Archive

Re: DownValues

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113719] Re: DownValues
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Tue, 9 Nov 2010 03:52:00 -0500 (EST)

The documentation on SubValues is extremely limited but it is not totally undocumented.

Names["*Values"]

{DefaultValues, DownValues, DynamicModuleValues, FormatValues, NValues, OwnValues, SingularValues, SubValues, UpValues}

Information[SubValues]

SubValues[f] gives a list of transformation rules corresponding to all subvalues (values for f[x,\[Ellipsis]][\[Ellipsis]], etc.) defined for the symbol f.

Attributes[SubValues]={HoldAll,Protected}
 
Options[SubValues]={Sort->True}


It is also referenced in: 
ref/message/DownValues/vlist
ref/message/DownValues/vrule
ParallelTools/tutorial/RemoteDefinitions


Bob Hanlon

---- Albert Retey <awnl at gmx-topmail.de> wrote: 

=============
Am 08.11.2010 09:38, schrieb Stephan:
> Hi,
> 
> Is there any way to find out about definitions like:
> 
> 	f[1][2] = 3 ?
> 
> Here is a sample run:
> 
> In[1]:= f[1][2] = 3
> Out[1]= 3
> In[2]:= DownValues[f]
> Out[2]= {}
> In[3]:= DownValues[f[1]]
> 	During evaluation of In[3]:= DownValues::"sym" :  "   
> 	StyleBox[\"\\\"\< is expected to be a symbol.\>\\\"\", \"MT\"]  \
> Out[3]= DownValues[f[1]]
> 
> So with "DownValues" I can't seem to learn about the definition f[1][2]...

SubValues, unfortunatly seem to be undocumented, but gives you what you
are looking for:

SubValues[f]

hth,

albert



  • Prev by Date: Re: Derivatives
  • Next by Date: Re: x and y labels in ArrayPlot
  • Previous by thread: Re: DownValues
  • Next by thread: Re: DownValues