On 7/7/07, Justin C. Walker <[EMAIL PROTECTED]> wrote:
> On Jul 7, 2007, at 10:44 , William Stein wrote:
> > So I propose that the only symbolic variables that are predefined
> > are x (since it's so useful to have this predefined), I (=sqrt(-1)),
> > and e (=2.7...).
> > If users want a symbolic variable, they have to use the var command.
>
> I prefer having nothing defined, although I suppose a case could be
> made for 'e' and 'I'.  If 'x' is pre-defined, then one could as "why
> not 'y'?", and it's downhill from there :-}

Not having x predefined would be reasonable.  It has always been
predefined since SAGE-0.9, mainly because it makes it much easier
to create number fields, etc.   However, it can lead to code and
examples that really make me nervous.  For example, if one
things the standard way to make a number field is:

    K.<a> = NumberField(x^3 + 1)

but one happens to define x to be a number or something
else in a session, e.g., by using x as a looping variable, e.g.,

   for x in object:
        print x

then there are problems.  It's probably much better to think
that the following are ways to make a number field:

  x = polygen(QQ)
  K.<a> = NumberField(x^3 + 1)

or

  x = var('x')
  K.<a> = NumberField(x^3+1)

> Having an explicit "var()" in a computation/script seems preferable.

Yep.

> On this subject, the question of "protection" for variable names was
> raised earlier, but I don't recall the outcome.

I think this sort of thing just doesn't work -- and shouldn't even be attempted
-- since Python is a dynamically typed language, so types and values
of a variable can (and must be allowed to) change at any time, unlike
with a statically typed language.

> > One other thing that surprised me was
> >  (1) how little all the symbolic code in SAGE was actually useful for
> > the workshop,
>
> This, I think, really depends on the user's habits, and it's really
> difficult to predict.  I often take advantage of the symbolic stuff,
> but then I sometimes trip over it.  Having it optional, as above, may
> be the best we can do.
>
> >  (2) how annoying it was not having decimal literals be floats by
> > default, and
> >  (3) how annoying it was having certain special functions, e.g.,
> >       log, sin, cos, etc., return symbolic values by default
> >       instead of numerical values.
>
> On this one, I'm neutral.
>
> How many configuration/usage options can we have before it starts
> getting too complex to deal with?

0.  We don't have any configuration/usage options and we shouldn't.
I'm just trying to figure out what the best 1 default option will be.

William

--~--~---------~--~----~------------~-------~--~----~
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