On 8/30/07, Waldek Hebisch wrote: > ... > > > BTW, I have sucessfully built axiom4sage-0.3.1 from the package. It > > > built with no problems, but trying to use it I see somwhat strange > > > output: > > > > > > sage: axiom.eval('1+1') > > > '\n 2\r\n > > >
Looking at this again, I see this result is not unusual. As I understand it, the 'eval' method is intended to return Axiom's output as a string. The normal way to interact with Axiom from Sage would be via the command: sage: axiom('1+1') To get the Axiom type of the result you might write: sage: p=axiom('1+1');p sage: p.type() > > > > I have somwhat strage terminal setup (I sit at a Linux console from > > > which I ssh to another machine running screen from where I ssh to > > > final destination), in particular my TERM setting is 'screen.linux' > > > (which confuses many programs). > > > > > Bill Page wrote: > > I don't think your terminal setup will affect this output (unless you > > know of something specific in Axiom that is sensitive to TERM).. > > GNU readline is definitely sensitive to TERM. Debugging various > problem I used the script program -- logs shows that output contains > terminal control sequences. > In order to use the pexpect interface reliably readline support in Axiom itself (inherited from Clisp) is internally disabled by Sage Axiom interface but I presume Sage itself still uses readline for it's user interface. I do not think this has anything to do with the result you show. > ... > I tried 2.8.2. BTW. print axiom.eval('1+1') works fine. Yes, since 'axiom.eval(...)' returns a string, this makes sense. > Also axiom.interact() works for math computation. That's cool. > However, if I use > > print "Hello" > > in intract mode the printout is not shown. I think this is a bug in 'axiom.interact()' related to parsing Axiom output. Try: axiom: print "xxx"; print "yyy" You can get some more idea of what is happening by setting verbose mode before entering 'interact': sage: set_verbose(4) sage: axiom.interact() --> Switching to Axiom <-- axiom: print "xxx"; print "yyy" verbose 3 (203: axiom.py, _eval_line) in = 'print "xxx"; print "yyy"' verbose 3 (203: axiom.py, _eval_line) out = 'print "xxx"; print "yyy" "xxx" "yyy" Type: Void ' "yyy" Type: Void --------- It seems to skip the first line of generated output. Although this does not apply to the 'interact' mode, Axiom's 'print' operation is an interesting example of a function that has an output-related side-effect. I am not sure how we should mark-up such program generated output so that another program like Sage can properly interpret it. Is this output associated with a particular Lisp stream, i.e. like $texOutputStream and $algebraOutputStream? > Similarly, Lisp output in > > )lisp (+ 1 1) > > is not shown. I was able to confuse interact mode typing > > )lisp (format t "Hello~%") > > which delayed output by one position: > > axiom: )lisp (format t "Hello~%") > > axiom: 12 > > alue = NIL > > axiom: 17 > > 12 > > > Type: > PositiveInteger > > axiom: > Ok thanks. I will look at this problem. Regards, Bill Page. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---