Annotation of 43BSDReno/share/doc/ps2/07.fp/manCh4.rno, revision 1.1.1.1

1.1       root        1: .\" Copyright (c) 1980 Regents of the University of California.
                      2: .\" All rights reserved.  The Berkeley software License Agreement
                      3: .\" specifies the terms and conditions for redistribution.
                      4: .\"
                      5: .\"    @(#)manCh4.rno  6.1 (Berkeley) 4/29/86
                      6: .\"
                      7: .NS 1 "System Commands"
                      8: .pp
                      9: System commands start with a right parenthesis and they are followed
                     10: by the command-name and possibly one or more arguments.  All this information
                     11: \fImust be typed on a single line\fP, and any number of spaces or tabs
                     12: may be used to separate the components.
                     13: .sp 4p
                     14: .NS 2 "Load"
                     15: .pp
                     16: Redirect the standard input to the file named by the command's
                     17: argument.
                     18: If the file doesn't exist then FP appends '.fp' to the file-name and retries
                     19: the open (error if the file doesn't exist).
                     20: This command allows the user to read in FP function definitions
                     21: from a file.
                     22: The user can also read in applications, but such operation is
                     23: of little utility since none of the input is echoed at the terminal.
                     24: Normally, FP returns control to the user on an end-of-file. 
                     25: It will also do so whenever it does a \s-2FRANZ\s+2 reset, e.g.,
                     26: whenever the user issues a break, or whenever the system encounters
                     27: a non-terminating application.
                     28: .sp 4p
                     29: .NS 2 "Save"
                     30: .pp
                     31: Output the source text for all user-defined functions to the file named
                     32: by the argument.
                     33: .sp
                     34: .NS 2 "Csave and Fsave"
                     35: .pp
                     36: These commands output the lisp code for all the user-defined
                     37: functions, including the original source-code, to the file named
                     38: by the argument.  Csave pretty prints the code,
                     39: Fsave does not.  Unless the user wishes to examine
                     40: the code, he should use 'fsave'; it is about
                     41: ten times faster than 'csave', and the resulting file
                     42: will be about three times smaller.
                     43: .pp
                     44: These commands are intended to be used with the liszt compiler and
                     45: the 'cload' command, as explained below.
                     46: .sp
                     47: .NS 2 "Cload"
                     48: .pp
                     49: This command loads or fasls in  the file shown by the argument.
                     50: First, FP appends a '.o' to the file-name, and attempts a
                     51: load.  Failing that, it tries to load the file named by
                     52: the argument.  If the user outputs his function definitions
                     53: using fsave or csave, and then compiles them using liszt,
                     54: then he may fasl in the compiled code and speed up the execution of
                     55: his defined functions by a factor of 5 to 10.
                     56: .sp
                     57: .NS 2 "Pfn"
                     58: .pp
                     59: Print the source text(s) (at the terminal) for the
                     60: user-defined function(s) named by the argument(s) (error if the function
                     61: doesn't exist).
                     62: .sp
                     63: .NS 2 "Delete"
                     64: .pp
                     65: Delete the user-defined function(s)
                     66: named by the argument (error if the function doesn't exist).
                     67: .sp
                     68: .NS 2 "Fns"
                     69: .pp
                     70: List the names of all user-defined functions in alphabetical order.
                     71: Traced functions are labeled  by a trailing '@'
                     72: (see \(sc 4.7 for sample output).
                     73: .sp
                     74: .NS 2 "Stats"
                     75: .pp
                     76: The \*(lqstats\*(rq command has several options
                     77: that help the user manage the collection of
                     78: dynamic statistics for
                     79: functions\**
                     80: .(f
                     81: \** Measurement of user-defined functions is done with
                     82: the aid of the trace package, discussed in \(sc 4.9.
                     83: .)f
                     84: and functional forms.
                     85: Option names follow the keyword \*(lqstats\*(rq,
                     86: e.g., \*(lq)stats reset\*(rq.
                     87: .pp
                     88: The statistic package records the frequency of usage for each function and
                     89: functional form; also the size\**
                     90: .(f
                     91: \** \*(lqSize\*(rq is the top-level length of the argument,
                     92: for most functions.  Exceptions are: \fIapndl, distl\fP (top-level length
                     93: of the second element), \fIapndr, distr\fP (top-level length of the first
                     94: element), and \fItranspose\fP (top level length of each top level
                     95: element).
                     96: .)f
                     97: of all the arguments
                     98: for all functions and functional expressions.
                     99: These two measures allow the
                    100: user to derive the average argument size per call.
                    101: For functional
                    102: forms the package tallies the frequency of each functional argument.
                    103: Construction has an additional statistic that tells the number of
                    104: functional arguments involved in the construction.
                    105: .pp
                    106: Statistics are gathered whenever the mode is on, except for
                    107: applications
                    108: that \*(lqbottom out\*(rq (\*(IE return bottom \- ?).
                    109: Statistic collection
                    110: slows the system down by $times 2~$ to $~times 4$.
                    111: The following
                    112: printout illustrates the use of the statistic package (user input
                    113: is emboldened):
                    114: .(b
                    115: .sp
                    116: .hl
                    117: .sp
                    118: .nf
                    119:        \fB)stats on\fP
                    120: 
                    121: Stats collection turned on.
                    122: 
                    123:        \fB+:<3 4>\fP
                    124: 7
                    125:        \fB!* @ iota :3\fP
                    126: 6
                    127:        \fB)stats print\fP
                    128: 
                    129: plus:  times   1
                    130: 
                    131: times: times   2
                    132: 
                    133: iota:  times   1
                    134: 
                    135: insert:        times   1       size    3
                    136: 
                    137:                        Functional Args
                    138:                Name                    Times
                    139:                times                   1
                    140: 
                    141: 
                    142: compos:        times   1       size    1
                    143: 
                    144:                        Functional Args
                    145:                Name                    Times
                    146:                insert                  1
                    147:                iota                            1
                    148: .fi
                    149: .sp 4p
                    150: .hl
                    151: .sp 4p
                    152: .)b
                    153: .NS 3 "On"
                    154: .pp
                    155: Enable statistics collection.
                    156: .sp 4p
                    157: .NS 3 "Off"
                    158: .pp
                    159: Disable statistics collection.  The user may
                    160: selectively collect statistics
                    161: using the on and off commands.
                    162: .sp 4p
                    163: .NS 3 "Print"
                    164: .pp
                    165: Print the dynamic statistics at the terminal, or, output them to
                    166: a file.  The latter option requires an additional argument,
                    167: \*(EG \*(lq)stats print fooBar\*(rq prints
                    168: the stats to the file \*(lqfooBar\*(rq.
                    169: .sp 4p
                    170: .NS 3 "Reset"
                    171: .pp
                    172: Reset the dynamic statistics counters.
                    173: To prevent accidental loss of collected statistics, the system
                    174: will query the user if he tries to reset the counters without first 
                    175: outputting the data (the system will also query the user if he tries
                    176: to log out without outputting the data).
                    177: .sp 4p
                    178: .NS 2 "Trace"
                    179: .pp
                    180: Enable or disable
                    181: the tracing and the dynamic measurement of the user 
                    182: defined functions named by the argument(s).
                    183: The first argument tells whether to turn tracing off or on and
                    184: the others give the name of the functions affected.
                    185: The tracing and untracing commands are independent of the dynamic statistics
                    186: commands.
                    187: This command is cumulative \*(EG
                    188: \&')trace\ on\ f1', followed by ')trace\ on\ f2' is equivalent
                    189: to ')trace\ on\ f1\ f2'.
                    190: .pp
                    191: FP tracer output is similar to the \s-2FRANZ\s+2 tracer output: function
                    192: entries and exits, call level, the functional argument
                    193: (remember that FP functions
                    194: have only one argument!), and the result, are printed at the terminal:
                    195: .(b
                    196: .sp
                    197: .hl
                    198: .sp 4p
                    199: .nf
                    200:        )pfn fact
                    201: 
                    202: {fact\ (eq0\ ->\ %1\ ;\ *\ @\ [id,\ fact\ @\ s1])}
                    203:        )fns
                    204: 
                    205: eq0    fact    s1           
                    206: 
                    207:        )trace on fact
                    208:        )fns
                    209: 
                    210: eq0    fact@   s1           
                    211: 
                    212:        fact : 2
                    213: 
                    214: 1 >Enter> fact [2]
                    215: |2 >Enter> fact [1]
                    216: | 3 >Enter> fact [0]
                    217: | 3 <EXIT<\ \ fact\ \ 1
                    218: |2 <EXIT<\ \ fact\ \ 1
                    219: 1 <EXIT<\ \ fact\ \ 2
                    220: 
                    221: 2
                    222: .fi
                    223: .sp 4p
                    224: .hl
                    225: .sp 4p
                    226: .)b
                    227: .NS 2 "Timer"
                    228: .pp
                    229: FP provides a simple timing facility to time top-level applications.
                    230: The command \*(lq)timer on\*(rq puts the system in timing mode,
                    231: \*(lq)timer off\*(rq turns the mode off (the mode is initially off).
                    232: While in timing mode, the system reports
                    233: CPU time, garbage collection time, and elapsed time,
                    234: in seconds.   The timing output follows the printout of the result of
                    235: the application.
                    236: .NS 2 "Script"
                    237: .pp
                    238: Open or close a script file. 
                    239: The first argument gives the option, the second the optional script file-name.
                    240: The \*(lqopen\*(rq option causes a new script-file to be opened and any
                    241: currently open script file to be closed.
                    242: If the file
                    243: cannot be opened, FP sends and error message and, if a
                    244: script file was already opened, it remains open.
                    245: The command \*(rq)script close\*(rq closes an open script file.
                    246: The user may elect to append script output to the script-file
                    247: with the append mode.
                    248: .NS 2 "Help"
                    249: .pp
                    250: Print a short summary of all the system commands:
                    251: .(b
                    252: .sp
                    253: .TS
                    254: center;
                    255: l l.
                    256: \ \ \ \ \ \ )help      \&
                    257: Commands are:  \&
                    258: \&     \&
                    259: .T&
                    260: l12 l.
                    261: load <file>    Redirect input from <file>
                    262: save <file>    Save defined fns in <file>
                    263: pfn <fn1> ...  Print source text of <fn1> ...
                    264: delete <fn1> ...       Delete <fn1> ...
                    265: fns    List all functions
                    266: stats on/off/reset/print [file]        Collect and print dynamic stats
                    267: trace on/off <fn1> ... Start/Stop exec trace of <fn1> ...
                    268: timer on/of    Turn timer on/off
                    269: script open/close/append       Open or close a script-file
                    270: lisp   Exit to the lisp system (return with '^D')
                    271: debug on/off   Turn debugger output on/off
                    272: csave <file>   Output Lisp code for all user-defined fns
                    273: cload <file>   Load Lisp code from a file (may be compiled)
                    274: fsave <file>   Same as csave except without pretty-printing
                    275: .TE
                    276: .sp
                    277: .)b
                    278: .NS 2 "Special System Functions"
                    279: .pp
                    280: There are two system functions that
                    281: are not generally meant to be used by average users.
                    282: .NS 3 "Lisp"
                    283: .pp
                    284: This exits to the lisp system.
                    285: Use "^D" to return to FP.
                    286: .NS 3 "Debug"
                    287: .pp
                    288: Turns the  'debug' flag on or off.  The command \*(lq)debug on\*(rq
                    289: turns the flag on, \*(lq)debug off\*(rq  turns the flag off.
                    290: The main purpose of the command is to print out the parse tree.
                    291: .bp
                    292: .sx 1

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.