> <\body> interpreter> This section describes how to use the interpreter > available from the package. From a terminal|terminal>, the interpreter is launched with the following command: <\shell-code> $ mmi -------------------------------------------------------------- \|:*) \ \ \ \ \ \ \ \ \ \ \ \ \ Welcome to Mathemagix 1.0.2 \ \ \ \ \ \ \ \ \ \ \ \ (*:\| \|------------------------------------------------------------\| \| \ This software falls under the GNU General Public License \ \| \| \ \ \ \ \ \ \ \ \ It comes without any warranty whatsoever \ \ \ \ \ \ \ \ \ \| \| \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ http://www.mathemagix.org \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \| \| \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (c) 2010-2012 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \| -------------------------------------------------------------- 1]\ At first run the following message should last several seconds, according to the performances of your computer: <\shell-code> mmi: compiling glue... This means that the fundamental librairies are being compiled. At next run, the message still appears but lasts just the time needed to check that these compiled libraries are up to date. Whenever the interpreter has been compiled with the library, several shortcuts are available such as <\itemize> , to go at the beginning or end of the instruction line, >, > for the previous and next instruction line, for name completion, to add an extra line to the current instruction line. Note that on several platforms the key is binded to . On the OSX> terminal, unless the key has been specifically set so from the terminal preferences menu, one must type and then . For more information and customization of the keyboard interface, please refer to the documentation of the library. Within an interactive session, ending a line with a '' actually means finishing with a null instruction. As a consequence this extra '' prevents from printing the output of the previous instruction. <\shell-code> 2 \ In order to quit the interpreter one can type , or call the function |> that takes the return value of the command as an argument. <\shell-code> For a short list of terminals (, , ), the color mode of the interpreter can be activated by adding the following option to the command line: <\shell-code> $ mmi --color -------------------------------------------------------------- \|:*) \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*:\| \|------------------------------------------------------------\| \| \ This software falls under the GNU General Public License \ \| \| \ \ \ \ \ \ \ \ \ It comes without any warranty whatsoever \ \ \ \ \ \ \ \ \ \| \| \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \| \| \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \| -------------------------------------------------------------- The |> option can be activated by default by setting the global environment variable |> to . For instance, if your default shell is , then you might want to add the following line to your file in order to get the color mode permanently: <\shell-code> export MMX_COLOR_MODE="yes" In this case, colors can be punctually disabled as follows: <\shell-code> mmi --no-color Supported terminals are specified in . The behavior of the interpreter can be modified according to the following command line options: <\description> >>|>Disable printing the banner and prompt. >|>Quit the interpreter after replaying a session. >|>Replay the previous session. >>>|>Enable the interface (to be used by only). >>|>Display compilation and executing timings. >>>|>Display types of computed expressions. >>>|>Enable verbose mode. The command line option summarizes the usage of , and returns the current version of . The following options are passed to the compiler for compiling dynamic librairies at runtime: , , , , , , , . Signatures and source locations of functions can be obtained via the |help> command as follows: <\shell-code> + : (Int, Int) -\> Int --- mmx/basix/mmx/int.mmx:30:10 + : (Double, Double) -\> Double --- mmx/basix/mmx/double.mmx:33:10 + : (Syntactic, Syntactic) -\> Syntactic --- mmx/basix/mmx/syntactic.mmx:33:8 = 1 then 1 else fib (n-2) + fib (n-1)> fib : Int -\> Int --- /Users/lecerf/.mathemagix/mmi/input_2.mmx:0:43 The latter source location corresponds the actual file where the input command is temporarily saved in. Help on types is also available: <\shell-code> Vector : Type -\> Class --- mmx/basix/mmx/vector.mmx:15:8 File inclusion is performed via the |glue> function, as for the compiler. If the file to be included or one of its dependencies contains declarations, for importing or exporting functions, then the necessary dynamic librairies are automatically compiled and loaded. During the compilation the message is displayed. This compilation might take time, but it is only performed once. <\shell-code> 815915283247897734345611269596115894272000000000 In case you are sure that all the dynamic libraries you are going to use in an interpreter session are already compiled then you might want to use the option in order to discard checking if these dynamic libraries are up to date. If the compiler and interpreter have been compiled with passing the option to the script, then a low level debugger is made available by adding |debugger> to the command. The features of the debugger are rather limited but are essentially useful to understand casual bugs, and to display the actual builtin types being used. The interactive commands of this debugger are the following: <\description> >set interactive mode. >unset interactive mode. >set display of expressions. >unset display of expressions. >set display of values. >unset display of values. >go directly to next step. >step into the intermediate. . If you don't have this file, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.> <\initial> <\collection>