Xmaxima communicating with



On Mon, 2008-06-09 at 13:48 +0200, Christian Jorgensen wrote:
> As part of a project for my education I need to find out how Xmaxima
> communicates with Maxima
Xmaxima uses a socket to communicate with maxima.

> grateful either for direct help here or for tips on specialised
> mailing lists or tutorials for that kind of questions.

The best place to learn about the subject is chapter 7 of "Effective
Tcl/Tk Programming: Writing Better Programs with Tcl and Tk".
You can download that chapter for free from:
http://www.informit.com/content/images/0201634740/samplechapter/09susarc.pdf

> When downloading Maxima from SourceForge Xmaxima comes with it.  In C:
> \Program Files\Maxima\bin I find an xmaxima file (437 KB) and an
> xmaxima Application (2,113 KB).  I assume that the contents of the
> Application is reflected in the File.

Right; Xmaxima is a single tcl script. The big file is a "starkit" which
includes an embedded version of the tcl/tk interpreter. If you want to
study Maxima, it is best to have tcl/tk installed and to call Xmaxima
from within a wish shell.

>  I have tried to study that file and to this end I have worked through
> some Tcl tutorials.  I can now followo a lot but not everything.  (For
> example I see a command "object_class MAXTkmasime {...} that I do not
> understand;
all the procedures that start by object_ are part of an additional
package, Objective Tcl. Five years ago Mike Clarkson thought that it
would be a good idea to turn Xmaxima from procedural to object-oriented,
and a few classes were introduce. You can find Objective Tcl in Maxima's
repository, in:
http://maxima.cvs.sourceforge.net/maxima/maxima/interfaces/xmaxima/ObjTcl/

> I find a large number of "procs" but I am looking for the commands
> that call these procs, something like a "main" file in Java.

if you removed all the procedures defined in Xmaxima, what would be left
would be the main program. The problem is that it consists of several
lines spread out in different places. There are even some global
definitions repeated at different places. All that mess is the result of
having put together several scripts that were developed independently.

Your task will be easier if you look at the independent tcl scripts in:
http://maxima.cvs.sourceforge.net/maxima/maxima/interfaces/xmaxima/Tkmaxima/

>From the name of the scripts you can guess their function. The
discussions about Xmaxima in the tcl/tk wiki might be also useful:
http://www.tcl.tk/maxima

Please, keep me posted on your progress; I'm also studying Xmaxima and
trying to improve it.

Regards,
Jaime