MathGroup Archive 2014

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

Search the Archive

Re: Default value in pattern matching


Actually, the property I looked after is not that Plus has a default value (though it is an insignificant part of the story), but that Plus has attribute OneIdentity, which affects pattern matching. 

SetAttributes[myPlus, OneIdentity]

Default[myPlus] = 0;
a /. {myPlus[a, b_.] -> "matched"}

Out[] = "matched"

The example given here is not exactly as the one in my question. But this is enough for my purpose.



  • Prev by Date: Re: How Can I Change the Appearance of a Locator in Manipulate
  • Next by Date: Re: How Can I Change the Appearance of a Locator in Manipulate
  • Previous by thread: Re: Default value in pattern matching
  • Next by thread: compensated summation in norm