Startup configuration

(directly go to documentation on : DefaultDirectory, PrettyPrinter'Set, PrettyPrinter'Get, PrettyReader'Set, PrettyReader'Get, MaxEvalDepth, HistorySize. )

# 4. Startup configuration

Yacas allows you to configure a few things at startup. The file `~/.yacasrc` is written in the Yacas language and will be executed when Yacas is run. The following functions can be useful in the `~/.yacasrc` file.

DefaultDirectory | add directory to path for Yacas scripts
PrettyPrinter'Set | set routine to use as pretty-printer
PrettyPrinter'Get | get routine to use as pretty-printer
PrettyReader'Set | set routine to use as pretty-reader
PrettyReader'Get | get routine that is currently used as pretty-reader
MaxEvalDepth | set depth of recursion stack
HistorySize | set size of history file

###

DefaultDirectory -- add directory to path for Yacas scripts

##### Internal function

##### Calling format:

    DefaultDirectory(path)

##### Parameters:

`path` -- a string containing a full path where yacas script files reside

##### Description:

When loading files, yacas is also allowed to look in the folder "path". `path` will be prepended to the file name before trying to load the file. This means that "path" should end with a forward slash (under Unix-like operating systems).

Yacas first tries to load a file from the current directory, and otherwise it tries to load from directories defined with this function, in the order they are defined. Note there will be at least one directory specified at start-up time, defined during compilation. This is the directory Yacas searches for the initialization scripts and standard scripts.

##### Examples:

    In> DefaultDirectory("/home/user/myscripts/");
    Out> True;

##### See also:

Load , Use , DefLoad , FindFile .

###

PrettyPrinter'Set -- set routine to use as pretty-printer

###

PrettyPrinter'Get -- get routine to use as pretty-printer

##### Standard library

##### Calling format:

    PrettyPrinter'Set(printer)
    PrettyPrinter'Set()
    PrettyPrinter'Get()

##### Parameters:

`printer` -- a string containing the name of a function that can "pretty-print" an expression.

##### Description:

This function sets up the function printer to print out the results on the command line. This can be reset to the internal printer with `PrettyPrinter'Set()` (when no argument is given, the system returns to the default).

Currently implemented prettyprinters are: `PrettyForm`, `TeXForm`, `Print`, `OMForm`, `CForm` and `DefaultPrint`.

`PrettyPrinter'Get()` returns the current pretty printer, or it returns an empty string if the default pretty printer is used.

##### Examples:

    In> Taylor(x,0,5)Sin(x)
    Out> x-x^3/6+x^5/120;
    In> PrettyPrinter'Set("PrettyForm");

    True

    In> Taylor(x,0,5)Sin(x)

         3    5
        x    x
    x - -- + ---
        6    120

    In> PrettyPrinter'Set();
    Out> True;
    In> Taylor(x,0,5)Sin(x)
    Out> x-x^3/6+x^5/120;

##### See also:

PrettyForm , Write , TeXForm , CForm , OMForm , PrettyReader'Set , PrettyReader'Get .

###

PrettyReader'Set -- set routine to use as pretty-reader

###

PrettyReader'Get -- get routine that is currently used as pretty-reader

##### Standard library

##### Calling format:

    PrettyReader'Set(reader)
    PrettyReader'Set()
    PrettyReader'Get()

##### Parameters:

`reader` -- a string containing the name of a function that can read an expression from current input.

##### Description:

This function sets up the function reader to read in the input on the command line. This can be reset to the internal reader with `PrettyReader'Set()` (when no argument is given, the system returns to the default).

Currently implemented PrettyReaders are: `LispRead`, `OMRead`.

`PrettyReader'Get()` returns the current reader, or it returns an empty string if the default pretty printer is used.

##### Examples:

    In> Taylor(x,0,5)Sin(x)
    Out> x-x^3/6+x^5/120
    In> PrettyReader'Set("LispRead")
    Out> True
    In> (Taylor x 0 5 (Sin x))
    Out> x-x^3/6+x^5/120

##### See also:

Read , LispRead , OMRead , PrettyPrinter'Set , PrettyPrinter'Get .

###

MaxEvalDepth -- set depth of recursion stack

##### Internal function

##### Calling format:

    MaxEvalDepth(n)

##### Parameters:

`n` -- integer

##### Description:

Sets the maximum depth of recursive function call. An error message is printed when too many recursive calls are executed, and this function can be used to increase or decrease the limit as necessary.

###

HistorySize -- set size of history file

##### Internal function

##### Calling format:

    HistorySize(n)

##### Parameters:

`n` -- number of lines to store in history file

##### Description:

When exiting, yacas saves the command line history to a file `~/.yacas_history`. By default it will save the last 1024 lines. The default can be overridden with this function. Passing -1 tells the system to save all lines.

##### Examples:

    In> HistorySize(200)
    Out> True;
    In> quit

##### See also:

quit .