FullForm , Echo , PrettyForm , PrettyPrinter , Write , WriteString , Space , NewLine , DefaultDirectory , FromFile , FromString , ToString , Read , LispRead , ReadToken , ToFile , Load , Use , DefLoad , FindFile , Input/Output

Input/Output


FullForm(expression)

FullForm(expression) : Displays evaluated form of "expression", and returns it.


Echo({...})

Echo writes the contents of the list passed to it to the current output, and calls NewLine(). If an entry in the list is a string it writes the string unstringified. Example:
f(x):=x^2;
Echo({"The square of two is ",f(2)});
which should write out "The square of two is 2" to the current output


PrettyForm(expr)

PrettyForm shows the expression in a nicer form, closer to the notation usually used when a human writes down an expression. Example:
In> PrettyForm(Taylor(x,0,9)Sin(x))

     /  3 \    5     /  7 \      9  
    -\ x  /   x     -\ x  /     x   
x + ------- + --- + ------- + ------
       6      120    5040     362880

Out> True;
This is generally useful when the result of a calculation is more complex than a simple number.


PrettyPrinter("printer")

PrettyPrinter("printer") : set up the function printer to print out the results on the command line. Example:
PrettyPrinter("PrettyForm");
This function can be reset to the internal printer with PrettyPrinter()


Write(...)

Write(...) : Write out the expressions contained in "..." (evaluated).


WriteString(string)

WriteString(string) : Writes out a literal string, which should be of the form "string" (surrounded by quotes). The argument is evaluated.


Space(nr)

Space(nr) : Print out "nr" spaces. The "nr" argument is optional, the default value being 1.


NewLine(nr)

NewLine(nr) : Print out "nr" newlines. The "nr" argument is optional, the default value being 1.


DefaultDirectory("path")

DefaultDirectory("path") : 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. 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.


FromFile("file") body

FromFile("file") body : Open "file" for reading, and execute body, returning its result.


FromString("string") body

FromString("string") body : use "string" to parse from when issuing a read from file, and execute body, returning its result.


ToString() body

ToString redirects all output (from Write or WriteString, for instance) to a string, and returns this string.


Read()

Read() : Read expression from current input, and return result. When the end of an input file is encountered, the token atom "EndOfFile" is returned.


LispRead()

Read() : Read expression from current input, and return result. When the end of an input file is encountered, the token atom "EndOfFile" is returned.

This function is different from Read() in that it parses an expression in lisp syntax: so you need to type (+ a b) in stead of a+b. The advantage of lisp syntax is that it is less unambiguous than the infix operator grammar Yacas uses by default.


ReadToken()

ReadToken() : Read token from current input, and return result. When the end of an input file is encountered, the token atom "EndOfFile" is returned.


ToFile("file")

ToFile("file") : Open "file" for writing, and execute body, returning its result.


Load("filename")

Load("filename") : Reads in and evaluates expressions from the file with file name filename. See also "Use".


Use("filename")

Use("filename") : Reads in and evaluates expressions from the file with file name filename if it hasn't been loaded before. This function makes sure the file will at least have been loaded, but not loaded twice. See also "Load".


DefLoad("filename")

DefLoad("filename") : Loads a file filename.def, which should have a list of functions, terminated by a }. This tells the system to load the file "filename" as soon as the user calls one of the functions named in the file (if not done so already). This allows for faster startup times, since not all of the rules databases need to be loaded, just the descriptions on which files to load for which functions.


FindFile(name)

FindFile returns the file that would be opened when a Load(name) would be invoked. It returns the full path to the file.