In order to anticipate the next question, if you are wotking in a script
instead of
the terminal.
The code
f(x,y)=x*y
print f(5,4)
raises
SyntaxError: can't assign to function call
The code
x,y=var('x,y')
f=x*y
print f(4,3)
raises
DeprecationWarning: Substitution using function-call syntax and unnamed
arguments is deprecated and will be removed from a future release of
Sage; you can use named arguments instead, like EXPR(x=..., y=...)
I know two "correct" ways to do that :
x,y=var('x,y')
f=x*y
print f(x=4,y=3)
or
x,y=var('x,y')
f=symbolic_expression(x*y).function(x,y)
print f(x,y)
Remark that
f=symbolic_expression(x*cos(y)).function(x,y)
print f(0,1) # 0
g=symbolic_expression(x*cos(y)).function(y,x)
print g(0,1) # 1!!
Hope it helps in any way
Laurent
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org