.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\" @(#)manCh4.rno 6.1 (Berkeley) %G%
System commands start with a right parenthesis and they are followed
by the command-name and possibly one or more arguments. All this information
\fImust be typed on a single line\fP, and any number of spaces or tabs
may be used to separate the components.
Redirect the standard input to the file named by the command's
If the file doesn't exist then FP appends '.fp' to the file-name and retries
the open (error if the file doesn't exist).
This command allows the user to read in FP function definitions
The user can also read in applications, but such operation is
of little utility since none of the input is echoed at the terminal.
Normally, FP returns control to the user on an end-of-file.
It will also do so whenever it does a \s-2FRANZ\s+2 reset, e.g.,
whenever the user issues a break, or whenever the system encounters
a non-terminating application.
Output the source text for all user-defined functions to the file named
These commands output the lisp code for all the user-defined
functions, including the original source-code, to the file named
by the argument. Csave pretty prints the code,
Fsave does not. Unless the user wishes to examine
the code, he should use 'fsave'; it is about
ten times faster than 'csave', and the resulting file
will be about three times smaller.
These commands are intended to be used with the liszt compiler and
the 'cload' command, as explained below.
This command loads or fasls in the file shown by the argument.
First, FP appends a '.o' to the file-name, and attempts a
load. Failing that, it tries to load the file named by
the argument. If the user outputs his function definitions
using fsave or csave, and then compiles them using liszt,
then he may fasl in the compiled code and speed up the execution of
his defined functions by a factor of 5 to 10.
Print the source text(s) (at the terminal) for the
user-defined function(s) named by the argument(s) (error if the function
Delete the user-defined function(s)
named by the argument (error if the function doesn't exist).
List the names of all user-defined functions in alphabetical order.
Traced functions are labeled by a trailing '@'
(see \(sc 4.7 for sample output).
The \*(lqstats\*(rq command has several options
that help the user manage the collection of
\** Measurement of user-defined functions is done with
the aid of the trace package, discussed in \(sc 4.9.
Option names follow the keyword \*(lqstats\*(rq,
e.g., \*(lq)stats reset\*(rq.
The statistic package records the frequency of usage for each function and
functional form; also the size\**
\** \*(lqSize\*(rq is the top-level length of the argument,
for most functions. Exceptions are: \fIapndl, distl\fP (top-level length
of the second element), \fIapndr, distr\fP (top-level length of the first
element), and \fItranspose\fP (top level length of each top level
for all functions and functional expressions.
These two measures allow the
user to derive the average argument size per call.
forms the package tallies the frequency of each functional argument.
Construction has an additional statistic that tells the number of
functional arguments involved in the construction.
Statistics are gathered whenever the mode is on, except for
that \*(lqbottom out\*(rq (\*(IE return bottom \- ?).
slows the system down by $times 2~$ to $~times 4$.
printout illustrates the use of the statistic package (user input
Stats collection turned on.
Enable statistics collection.
Disable statistics collection. The user may
selectively collect statistics
using the on and off commands.
Print the dynamic statistics at the terminal, or, output them to
a file. The latter option requires an additional argument,
\*(EG \*(lq)stats print fooBar\*(rq prints
the stats to the file \*(lqfooBar\*(rq.
Reset the dynamic statistics counters.
To prevent accidental loss of collected statistics, the system
will query the user if he tries to reset the counters without first
outputting the data (the system will also query the user if he tries
to log out without outputting the data).
the tracing and the dynamic measurement of the user
defined functions named by the argument(s).
The first argument tells whether to turn tracing off or on and
the others give the name of the functions affected.
The tracing and untracing commands are independent of the dynamic statistics
This command is cumulative \*(EG
\&')trace\ on\ f1', followed by ')trace\ on\ f2' is equivalent
FP tracer output is similar to the \s-2FRANZ\s+2 tracer output: function
entries and exits, call level, the functional argument
(remember that FP functions
have only one argument!), and the result, are printed at the terminal:
{fact\ (eq0\ ->\ %1\ ;\ *\ @\ [id,\ fact\ @\ s1])}
FP provides a simple timing facility to time top-level applications.
The command \*(lq)timer on\*(rq puts the system in timing mode,
\*(lq)timer off\*(rq turns the mode off (the mode is initially off).
While in timing mode, the system reports
CPU time, garbage collection time, and elapsed time,
in seconds. The timing output follows the printout of the result of
Open or close a script file.
The first argument gives the option, the second the optional script file-name.
The \*(lqopen\*(rq option causes a new script-file to be opened and any
currently open script file to be closed.
cannot be opened, FP sends and error message and, if a
script file was already opened, it remains open.
The command \*(rq)script close\*(rq closes an open script file.
The user may elect to append script output to the script-file
Print a short summary of all the system commands:
load <file> Redirect input from <file>
save <file> Save defined fns in <file>
pfn <fn1> ... Print source text of <fn1> ...
delete <fn1> ... Delete <fn1> ...
stats on/off/reset/print [file] Collect and print dynamic stats
trace on/off <fn1> ... Start/Stop exec trace of <fn1> ...
timer on/of Turn timer on/off
script open/close/append Open or close a script-file
lisp Exit to the lisp system (return with '^D')
debug on/off Turn debugger output on/off
csave <file> Output Lisp code for all user-defined fns
cload <file> Load Lisp code from a file (may be compiled)
fsave <file> Same as csave except without pretty-printing
.NS 2 "Special System Functions"
There are two system functions that
are not generally meant to be used by average users.
This exits to the lisp system.
Use "^D" to return to FP.
Turns the 'debug' flag on or off. The command \*(lq)debug on\*(rq
turns the flag on, \*(lq)debug off\*(rq turns the flag off.
The main purpose of the command is to print out the parse tree.