Re: [sage-devel] Adding a new type

2010-10-27 Thread Florent Hivert
  Hi Victor,

On Wed, Oct 27, 2010 at 01:55:21PM -0700, VictorMiller wrote:
> I would like to experiment with adding some new types.  One of the is
> SemiRing (this is an algebraic structure which is like a ring except
> that there might not be an additive inverse -- think of the
> nonnegative integers).  I would like to insert it in the class
> hierarchy so that every Ring is a SemiRing.  Would the best way to to
> change ring.pyx in sage.rings, or is there something extra that I need
> to do with categories?

There is already a category Semirings (with not that much in it) together with
an example: NonNegativeIntegerSemiring. See
sage/category/semirings.py
sage/rings/semirings/non_negative_integer_semiring.py
See #9056 (merged in 4.4.4). I'm not sure what the plan is but probably
everything which is in the rings.pyx file should be moved in the proper
category file.

Cheers,

Florent

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Adding a new type

2010-10-27 Thread VictorMiller
I would like to experiment with adding some new types.  One of the is
SemiRing (this is an algebraic structure which is like a ring except
that there might not be an additive inverse -- think of the
nonnegative integers).  I would like to insert it in the class
hierarchy so that every Ring is a SemiRing.  Would the best way to to
change ring.pyx in sage.rings, or is there something extra that I need
to do with categories?

Victor

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org