On Mon, Oct 29, 2007 at 02:00:18PM -0700, William Stein wrote:
> On 10/29/07, Joel B. Mohler <[EMAIL PROTECTED]> wrote:
> > sage: P.<alpha_15>=ZZ[[]]
> > sage: latex(P)
> > \mathbf{Z}[[\alpha_{15}]]
> >
> > sage: P,alpha_beta12=PolynomialRing(ZZ,'alpha_beta12').objgen()
> > sage: latex(alpha_beta12)
> > \alpha_{\beta_{12}}
> >
> > Both of the above examples throw an exception in 2.8.10 about not being
> > alphanumeric.  I think that was a slightly overzealous requirement and I've
> > changed the validation in preparser.py and parent_gens.pyx to allow
> > non-leading '_' characters in variable names.
> 
> No, there was a very good reason why underscores were
> not allowed in variable names.  I think it was that they
> are not allowed in SINGULAR polynomial variable names,
> hence you're changing sage to strongly encourage creation
> of variable names, so that any time we coerce them to Singular
> it will go boom.   I can't remember if Singular was the
> only system with this sort of problem; there might be others.

Ok, I can see that that would be an issue, but it seems sad to reduce a 
feature just because of another system that the user may have no direct 
interest in.  At the moment, we allow underscores in symbolic variable names 
which then go boom when you try to turn them into polynomials:

sage: x_1=var('x_1')
sage: (x_1^2+x_1).polynomial(ZZ)
...
<type 'exceptions.ValueError'>: variable names must be alphanumeric, but one 
is 'x_1' which is not.

I tried to break the singular interface with an '_' in my patched version and 
could not do so.  It also seems that the singular language itself allows 
underscores.  I realize that the argument isn't so much about singular as 
some language that didn't allow '_' (for some value of 'some').  I do know 
that mathematica treats '_' specially (which really annoyed me back when I 
used mathematica).

Anyhow, I guess my rock bottom question is whether this design restraint could 
be reconsidered?  I'd be much happier to see some concrete systems that it 
breaks that we need (and mathematica doesn't count in my mind since it 
doesn't come with sage).  We certainly should be consistent between symbolic 
variable names and generators (which we aren't now).

--
Joel

--~--~---------~--~----~------------~-------~--~----~
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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to