Hi Chris, On 14 Mrz., 23:31, chris wuthrich <christian.wuthr...@gmail.com> wrote: > 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.]
Well, f(1.) is in fact contained in the base ring of the parent of f, so everything is formally fine: sage: f.parent() Callable function ring with arguments (x,) sage: f.parent().base_ring() Symbolic Ring sage: f(1.).parent() Symbolic Ring > 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. +1 (but where is the second reason?) > 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) I don't like this approach. I would allow both f(x=0) and f(x=1), in both cases returning a univariate polynomial. Cheers, Simon -- 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