> First I cannot reproduce it on 2.8.14 (so it's probably only a bug in
> 2.8.15?):
>
> $ ./sage
> ----------------------------------------------------------------------
> | SAGE Version 2.8.14, Release Date: 2007-11-24 |
> | Type notebook() for the GUI, and license() for information. |
> ----------------------------------------------------------------------
>
> sage: t = var("t")
> sage: f = t*cos(0)
> sage: f
> t
> sage: f(1)
> 1
> sage: f = t*sin(0)
> sage: f
> 0
> sage: f(1)
> 0
> sage: float(f(1))
> 0.0
> sage: (t*sin(0)).variables()
> ()
>
>
> Second, I find the f(1) syntax very confusing. Exactly because it's
> not clear what is substituted for. Why isn't the syntax:
>
> f.subs(t, 1) enough?
Maybe it is. I've been thinking about removing the f(1) syntax,
*unless* something is
a "callable symbolic expression", e.g.,
sage: f(t) = t*sin(0)
sage: f(1)
0
sage: float(f(1))
0.0
A drawback though is that if we do this then all of the following break, which
will confuse new users:
sage: f = x^2 + x + 1
sage: f(5)
31
sage: show(plot(f, -2, 2))
sage: show(plot(sin(x)*cos(x^2), -pi, 3*pi))
For the first, you just suggest in the error message to do either
f(x=5) or f(x,5) or
f(x) = ...; for the second, we can modify plot to optionally work like this:
sage: show(plot(f, x, -2, 2))
(actually the above already works)
or
sage: show(plot(f, (x, -2, 2)))
William
-- Willim
--~--~---------~--~----~------------~-------~--~----~
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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---