MathGroup Archive 2011

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

Search the Archive

Re: Unwanted Recursion


On 07/07/2011 12:39, David Bailey wrote:
> In[649]:= p[a_]:=a;
>
> In[650]:= p[a]
>
> Out[650]= a
>
Sorry, I didn't notice that you had used the Flat attribute. I suggest 
you use:

In[1]:= SetAttributes[p, {Flat, OneIdentity}]

In[4]:= p[a_] := a

In[5]:= p[b]

Out[5]= b

This works without any errors.

David Bailey
http://www.dbaileyconsultancy.co.uk



  • Prev by Date: Re: Bug 1+4/10
  • Next by Date: Re: Stacked fractions
  • Previous by thread: Re: Unwanted Recursion
  • Next by thread: Re: Unwanted Recursion