Input/Output
FullForm(expression)
FullForm(expression) :
Displays evaluated form of "expression", and returns it.
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.