From r.hankin at noc.soton.ac.uk  Mon Feb  4 15:25:49 2008
From: r.hankin at noc.soton.ac.uk (Robin Hankin)
Date: Mon, 4 Feb 2008 14:25:49 +0000
Subject: [Rd] a != a*1  != a+0 != +a
Message-ID: <AE7B33FB-AFBC-40BD-9503-5C25ACFD4E23@noc.soton.ac.uk>

hits=1.0 tests=MANY_EXCLAMATIONS
X-USF-Spam-Flag: NO

Hi

I am writing a package for multivariate polynomials ('multipols')
using S3 methods.

The package includes a Ops.multipol()  function for the
arithmetic methods;  I would like
to define some sort of user-specified Boolean option which, if
set,  would force results to be simplified as they are produced.

Call this option "trim".  Trimming a multipol results in
a smaller array that is more manageable.

Mostly one wants to trim, sometimes not.


Would options() be a good way to manage this?

One issue is the behaviour of unary operators "+" and "-".

If trim is TRUE, then  "a"   is one thing,  but "+a"  returns
"trim(a)", which might be different.

Also "1*a" would be different from "a" and "a+0"



Does the List consider this to be Good Practice?

Has anyone got comments?



--
Robin Hankin
Uncertainty Analyst and Neutral Theorist,
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743



[Rd] a != a*1 != a+0 != +a
Robin Hankin