On 10/11/12 6:46 AM, sageuser wrote:
*Hello Sage team.
I would like to build callable symbolic expression into some python code
file an load (import) it. Since it's before Sage parse it, expression
like f(x) = x**2 is of course forbidden.
You'd just have to do what the preparser does:
sage: preparse('f(x)=x^2')
'__tmp__=var("x"); f = symbolic_expression(x**Integer(2)).function(x)'
So take your symbolic expression S and do S.function(x).
For example:
sage: f = SR(1).function(x)
sage: f(4)
1
Thanks,
Jason
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.