On 02/08/2013 15:16, William Stein wrote:
On Fri, Aug 2, 2013 at 5:54 AM, Emmanuel Charpentier
<[email protected]> wrote:
[ Snip... ]
In the maxima.interact() call, sage "sees" the question from maxima, and
acts accordingly (here, suggests an assumption that cannot be made...).
Is that the intended effect of maxima.interact ?
Yes. maxima.console() fires up an entirely new maxima console (a
whole new session) and directly dumps the user into it.
maxima.interact() simply takes the existing maxima session -- the (or
a) one that Sage controls -- and lets the user directly type commands
to it and have results displayed back; all the interaction goes
through exactly the same mechanism (mainly pexpect) that Sage uses for
commands like maxima.eval. There are a dozen other interfaces that
have a .interact() method that works like this.
Implementing something like you want might be a good idea or
interesting though.
Below, I try to clarify what I wanted to do :
Maxima is still Sage's main tool for symbolic analysis. However, it
sometiomes needs information that the current pexpect() doesn't know how
to process. Furtehrmore, it sometimes needs information that *cannot* be
given in advance with Maxima's language. What I wanted was a way to
interact *directly* with the *current* Maxima session through a "dumb"
pipe, without pexpect() pre- and post-processing.
How I see things currently :
Default Maxima use :
User <--> Sage user interface <--> Sage processing <--> pexpect <-->
Sage's maxima
maxima.console()
User <--> Sage user interface <--> dumb pipe <--> New maxima
maxima.interact()
User <--> Sage user interface <--> pexpect <--> Sage's maxima
What I (think I) want :
User <--> Sage user interface <--> dumb pipe <--> Sage's Maxima
What I think what I want entails :
User <--> Sage user interface <-+-> dumb pipe <--------------------+->
Sage's Maxima
| |
+-> Sage processing <--> pexpect <-+
The points marked by "+" on the top line are switches controlled by
Sage (with states : "normal use" or "my interact") controlling :
* On Maxima's end :
o where maxima input stream should come from
o where maxima's output qnd error streams should go to
* On Sage's end :
o where Sage user interface output should go to
o where Sage user interface input should come from.
The trick is, of course, to maintain them synchronous.
This can be done, I think, by implementing just a bidirectional
(tridirectional ?) dumb pipe from Sage's maxima to Sage and implementing
the switching in Sage.
I think that in various unices, this is easily done. Not quite so sure
abour Windows (even with Cygwin), since windows has no real fork().
What do you think ?
Emmanuel Charpentier
-- William
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.