Hi Miguel,

can you be convinced to work on it some more? 

1) Local orderings are fully supported in Sage. Take a look at 

  sage/rings/polynomial/term_order

where you'll also find a dictionary with mappings from Singular term order 
names to Sage term order names (and vice versa). 

2) Your code doesn't work with finite field extensions:

sage: K.<a> = GF(2^4)
sage: P.<x,y> = PolynomialRing(K)
sage: r = P._singular_()
sage: coerce_ring_from_singular(r)
    228     """
    229     if not names is None: name = names
--> 230     order = int(order)
    231     name = normalize_names(1,name)
    232
TypeError: int() argument must be a string or a number, not 'tuple'

3) Your construction for number fields seems inefficient to me:

sage: x = var('x')
sage: K.<a> = NumberField(x^2 + 1)
sage: P.<x,y> = PolynomialRing(K)
sage: r = P._singular_()
sage: coerce_ring_from_singular(r)
Defining a
Multivariate Polynomial Ring in x, y over Univariate Quotient Polynomial Ring 
in abar over Rational Field with modulus a^2 + 1

Why don't you just construct the appropriate number field?

4) Injecting a variable into the global namespace in a function ('defining a') 
is bad practice, IMHO. It should be avoided. It is better to create a 
variable in the local scope and pass it on to eval.

5) Using eval is not a good idea:

sage: eval("1/2")
0
sage: sage_eval("1/2")
1/2

use sage_eval instead.

Cheers,
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to