#5607: confusing syntax for creating symbolic functions
----------------------+-----------------------------------------------------
Reporter: burcin | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone: sage-3.4.1
Component: calculus | Keywords:
----------------------+-----------------------------------------------------
In a [comment:ticket:5413:12 comment] to #5413 Jason pointed out the
following confusing behavior:
{{{
sage: g(x)=sin
sage: g(3)
sin(3)
sage: g(x)=sin+x
sage: g(3)
sin + 3
sage: g(x)=sin+cos; g(3)
sin + cos
}}}
I think the syntax for this should be:
{{{
sage: g(x) = sin(x) + 3
sage: g(3)
sin(3) + 3
sage: g(x) = sin(x) + cos(x)
sage: g(3)
sin(3) + cos(3)
}}}
Since it is not clear which variable to use if only `sin` is specified.
Also consider this situation:
{{{
sage: g(x,y) = sin + y
sage: g(3,4)
???
}}}
We have two options:
* We could allow this syntax for convenience:
{{{
sage: g(x) = sin + x
}}}
and convert the function arguments to appropriate callable expressions if
the number of arguments of `g` match the number of arguments of the given
function, raise an error otherwise.
* We raise an error whenever a function object is specified without
variables.
Comments?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5607>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en
-~----------~----~----~----~------~----~------~--~---