MathGroup Archive 2008

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

Search the Archive

Re: Don't understand behavior of ClearAttributes[Plus,

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85163] Re: Don't understand behavior of ClearAttributes[Plus,
  • From: Alain Cochard <alain at geophysik.uni-muenchen.de>
  • Date: Wed, 30 Jan 2008 06:15:35 -0500 (EST)
  • References: <200801160830.DAA10128@smc.vnet.net> <fmmk8b$epl$1@smc.vnet.net> <fmv1db$2om$1@smc.vnet.net>

danl at wolfram.com writes:

>> I find it difficult to understand your view.  I don't see why
>> advertising for the ordering rules prevents Mathematica from
>> changing them (advertising the new ones), leaving to the user the
>> responsibility to be aware of those new rules, if he cares at all.
>> My understanding is that one can always determine an order by use
>> of Sort or OrderedQ; but seems to me it's just extra work than
>> could be avoided.

> I can give two reasons.
>
> (1) It would entail a level of documentation that was difficult to
> write, prone to error, and applicable to but few users. To me that is
> a recipe for doing more harm than good.
>
> (2) There really are programming semantics that, in my opinion, should
> be regarded as "details of the implementation". I feel this is one of
> them.
>
> I will grant that you may be able to formulate god reasons for
> disputing this. But I don't think that will be the case for the
> situation at hand, where you also are redefining an attribute of a
> basic arithmetic operation. As a general remark about such things, I
> believe there are always better ways to work with, say, noncommutative
> rings/algebras, than to attempt to overload Plus by changing its
> attributes.


OK, I guess I'll have to live with those reasons for the time being.
I sure prefer no documentation rather than buggy documentation...
Perhaps it should then be specified, in the section "Ordering of
Expressions" and/or in the Sort page, that such documentation does not
exist (and why not).  That could save some of us the trouble of
looking for it.

Thanks for the other explanations and thanks for your time (I'll be
holding my breathe about the OrderedQ[{">","/"}] versus
OrderedQ[{">b","/a"}] --at least apparent-- contradiction).

And also many thanks to Jose Luis Gomez for his detailed explanations.

Alain


  • Prev by Date: Re: Converting Radians into Degrees into Mathematica 6.01
  • Next by Date: Re: Text XY-size control in 2D graphics?
  • Previous by thread: Re: Don't understand behavior of ClearAttributes[Plus,
  • Next by thread: Re: Don't understand behavior of ClearAttributes[Plus,Orderless]