FullForm , Echo , PrettyForm , Write , WriteString , Space , NewLine , FromFile , FromString , ToString , Read , LispRead , ReadToken , ToFile , Load , Use , DefLoad , FindFile , PatchLoad , 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.


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.


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.


PatchLoad

Internal function
Calling Sequence:
PatchLoad(filename)
Parameters:
filename - the file to patch
Description:
PatchLoad loads in a file and outputs the contents to the current output. The file can contain blocks delimited by <? and ?> (meaning Yacas Begin and Yacas End). The piece of text between such delimiters is treated as a separate file with Yacas instructions, which is then loaded and executed. All output of write statements in that block will be written to the same current output.

This is similar to the way php works. You can have a static text file with dynamic content generated by Yacas.
See Also:
PatchString , Load ,