On 6/28/11 9:47 AM, Michael Orlitzky wrote:
On 06/28/11 09:12, kcrisman wrote:
Here you probably mean something else. Are you getting a deprecation
warning?
It's better to define
a(x) = x
b(x) = 2*x
I know this for the Sage prompt, but it doesn't work in a Python file
because without the preprocessing it tries to evaluate 'a' at 'x'.
Just FYI, you could make a .sage file, which is preparsed when "load"ed
or "attach"ed. Of course, it won't be preparsed when it is imported.
On the other hand, when you load or attach a .sage file, I believe an
equivalent .py file (the result of the preparsing) is created, which you
then can import.
Or you can just see how to do the above by calling the preparse function:
sage: preparse('a(x)=2*x')
'__tmp__=var("x"); a = symbolic_expression(Integer(2)*x).function(x)'
Thanks,
Jason
--
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