I hope we agree that evaluation (meaning evaluation of all variables
by some elements in a ring) should yield an element of the ring. I
don't mind if subs should give back a polynomial in all cases.

[Aside: Strangely this is not the case for symbolic expressions. I am
sure there must have been a discussion on this and I missed it. E.g.
f(x) = sin(x)
f(1.).floor()
does not work.]

> I agree that thats the only valid question here: is f(x=2,y=3) substitution
> or evaluation? The call syntax suggests evaluation, but keywords allow you
> to only substitute some variables. I'm tempted to say that since its not
> obvious we shouldn't have the function at all, that is, don't allow keyword
> arguments in _call_.

No I am against changing this. For two reasons, when working with
polynomials in variable names liks "k", "p". It is not always easy to
remember which was the first and which was the second variable. Then
it is very handy to pass keywords for evaluation - but still to expect
a base_ring element.

Instead I think we should check that all variables are evaluated. This
would be consistent with the call f(2,3) which screams when the number
of variables is not correct. Even better, we could check if the result
is really a ring element after substitution, which is easy to do. E.g.
I would allow
f = x*(x+y)
f(x=0)
but not
f(x=1)

Chris.

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

Reply via email to