On Dec 3, 12:31 pm, Robert Bradshaw <[EMAIL PROTECTED]>
wrote:
> On Dec 3, 2008, at 12:15 PM, Jason Grout wrote:
>
> > However, mathematical convention says that x is a dummy variable,  
> > and so
> > there should be no difference between f(x) = sin(x) and f(y)=sin(y).
> > However, currently, each tramples on different parts of the global
> > namespace.
>
> Mathematically, it's a dummy variable, but implementation-wise there  
> is a distinction. Consider
>
> sage: f(x) = sin(x)
> sage: f + x
> x |--> sin(x) + x
>
> sage: f(y) = sin(y)
> sage: f + x
> y |--> sin(y) + x

Yuck; I don't like this.  (But there's a lot I don't like about how
the symbolics system conflates functions and expressions, converting
back and forth in a way that feels arbitrary and confusing to me.)

> > I think the preparser ought to return
>
> > sage: preparse('f(x)=sin(x)')
> > '_=sage.calculus.calculus.var("x");f=symbolic_expression(sin
> > (_)).function(_)'
> > sage: f
> > x |--> sin(x)
>
> > (where "_" should be a temporary variable).  This way the global
> > namespace is not affected by what conventionally is a dummy variable.

I agree.

> > Simon pointed out that there is precedence for injecting variables  
> > that
> > appear on the left side of an equals sign, using "R.<x> = QQ[]" as an
> > example.
>
> > Any comments or thoughts?
>
> I think this is very useful.

I have no idea which "this" you're talking about.  (The current
behavior for "R.<x> = ..."?  The current behavior for "f(x) = ..."?
Jason's proposed modification for "f(x) = ..."?)

> - Robert

Carl

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
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