> >>> The current syntax allows this:
>
> >>> sage: f(x,y) = a*x + b*y
> >>> sage: f(5)
> >>> b*y + 5*a
> >>> sage: f(5)(5)
> >>> b*y + 25
>
> >>> I think the last line should be a syntax error.
>
> >> I agree, since f was explicitly defined with variables x and y.
>
> >> f(5) should return a function g(y) = b*y+5*a
>
> >> I think this could be easily changed (just return a function that has
> >> explicit variables, rather than just a symbolic expression).
>
> > I would still like to check that the length of the arguments match, and
> > raise an error if they don't. So, continuing the above example,
>
> > sage: f(5)
>
> > should raise an error.
>
> > It might be better if
>
> > sage: f(5, None)
>
> > or
>
> > sage: f(5,y)
>
> > returned the function g(y) = b*y+5*a.
>
> I agree with both of those alternatives, and agree that it would be
> better to insist that f take two arguments.
>
> Jason

These last suggestions seem reasonable for symbolic expressions of
more than one argument/variable, very much in the spirit of the (very
important and useful) compromise to have 'x' predefined as a variable
but none others.

If x^2 isn't callable, though, I might as well not use Sage in the
undergraduate classroom, or at least not ask any students to use it.
Well, maybe that's a stretch for me to claim?  I'm not sure, honestly,
but ... it's just that computer mathematics systems are pedantic
enough as it is - for obvious reasons, but with too much of it I would
rather teach 1900-style and have them learn to visualize and compute
on their own (radical idea, I know!), since that also has a lot of
benefits pedagogically and mathematically.  But I would really rather
have both.

Just my two cents.

- kcrisman

--~--~---------~--~----~------------~-------~--~----~
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to