On Sat, Sep 13, 2008 at 7:07 PM, Martin Rubey wrote: > > > Mostly, because I think the following *should* work... > > sage: a = axiom.sin(x) >
This does already work for me without any additional changes to axiom.py: sage: a=axiom.sin(x) sage: a sin(x) sage: a.type() Expression Integer Note: In Sage 'x' is the only pre-defined variable. sage: b=axiom.sin(y) --------------------------------------------------------------------------- NameError Traceback (most recent call last) /home/page/<ipython console> in <module>() NameError: name 'y' is not defined > I hacked around axiom.py a little, and came up with the following: > > #If all else fails, try using the unparsed input form > try: > import sage.misc.sage_eval > try: > vars = str(self.variables())[1:-1] > return > sage.misc.sage_eval.sage_eval(self.unparsed_input_form(),cmds='var(\''+vars+'\')') > except: > return > sage.misc.sage_eval.sage_eval(self.unparsed_input_form()) > except: > raise NotImplementedError > > This takes into account the fact that in sage we have to introduce all > variables... > I am not sure I like this change in behavior of Sage. > Unfortunately, we are still not there, because unparsed_input_form > returns > > 'sin x' > > (In FriCAS, one can omit parentheses, if a function takes only a single > argument.) > > Is there an easy way to massage this string in python, or should I rather > do it in FriCAS? (I guess I should...) > ??? I think it works already. Regards, Bill Page. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" 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/fricas-devel?hl=en -~----------~----~----~----~------~----~------~--~---
