MathGroup Archive 2014

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

Search the Archive

Re: Why does _+_==2_ (or, why is HoldPattern required

  • To: mathgroup at smc.vnet.net
  • Subject: [mg132245] Re: Why does _+_==2_ (or, why is HoldPattern required
  • From: Alan G Isaac <alan.isaac at gmail.com>
  • Date: Wed, 22 Jan 2014 03:31:46 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20140120085945.0A76D69CD@smc.vnet.net> <20140121034238.GM44705@wolfram.com>

On 1/20/2014 10:42 PM, Itai Seggev wrote:
> MatchQ[x+x, _+_] would return False


That is actually much less surprising to me:
one expects evaluation of the first expression.
What is quite surprising is that `_+_` does
not stand for any+thing, `_*_` does
not stand for any*thing, etc.
(Not unless one uses HoldPattern.)
I do not consider these "edge cases".

As you say, a decision had to be made.
I am just trying to understand the decision.
Your answer that it treats all symbolic expressions
equally is very likely a good answer in the end,
but of course on its own it begs the question.

Thanks,
Alan Isaac




  • Prev by Date: Re: How to show 1+2+3+ ... = -1/12 using Mathematica's symbols?
  • Next by Date: Re: How to show 1+2+3+ ... = -1/12 using Mathematica's symbols?
  • Previous by thread: Re: Why does _+_==2_ (or, why is HoldPattern required
  • Next by thread: BSplineSurface & BSplineFunction_Extracting Data