Re: D attributes
- To: mathgroup at smc.vnet.net
- Subject: [mg27745] Re: D attributes
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Wed, 14 Mar 2001 04:06:45 -0500 (EST)
- References: <98knl3$pnd@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Arturas,
It seems that this action on lists is programmed in directly - we don't need
to use the attribute.
Example:
d[x_]:=a[x]
d[x_List]:= d/@x
d[{x,y,{x}}]
{a[x],a[y],{a[x]}}
--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
"Arturas Acus" <acus at itpa.lt> wrote in message
news:98knl3$pnd at smc.vnet.net...
> Dear Group,
>
> This is very simple question.
> What is the D function mechanism which let it
> to go inside lists. See example
>
> In[1]:=
> $Version
> Out[1]=
> "4.0 for Linux (April 21, 1999)"
>
> In[2]:=
> Attributes[D]
> Out[2]=
> {Protected, ReadProtected}
>
> In[3]:=
> D[{x, y, {x}}, x]
> Out[3]=
> {1, 0, {1}}
>
> Why it goes inside lists if there is no Listable
> attribute? The same test is true for 4.1 also.
>
> Sincerely, Arturas
>
>
> Dr. Arturas Acus
> Institute of Theoretical
> Physics and Astronomy
> Gostauto 12, 2600,Vilnius
> Lithuania
>
>
> E-mail: acus at itpa.lt
> Fax: 370-2-225361
> Tel: 370-2-612906
>