;;; ************************************************************************* ;;; UserMan: Automatic User Manual Creation. ;;; Version 2.0 20-OCT-94. ;;; Written by Mark Kantrowitz, CMU School of Computer Science. ;;; Copyright (c) 1990-94. All rights reserved. ;;; Use, copying, modification, and distribution permitted. ;;; See the copyright notice in the source for details. ;;; ************************************************************************* DATOURA[124]> (create-user-manual "dtable.lsp") ;;; ;;; *DTABLE-PRINT-LENGTH* (5) [CONSTANT] ;;; how many elements of the columns to print ;;; ;;; DTABLE (header label data types stats groups ordering hidden [STRUCTURE] ;;; deleted active ...) ;;; dtable == The data table structure, containing the data, headers, ;;; groups and state of the data table ;;; ;;; CONVERT-TO-NUM (seq) [FUNCTION] ;;; convert-to-num (seq) -- convert the elements in sequence to numbers ;;; iff all of them are numbers ;;; ;;; PARSE-CSV-LINE (x) [FUNCTION] ;;; parse-csv-line (x) -- given a line from read-csv-line reads and ;;; casts values to their appropriate type. ;;; ;;; CSV-TO-LINES (filename) [FUNCTION] ;;; ;;; STRING-TRIM-STD (s) [FUNCTION] ;;; ;;; CSV-TO-LINES2 (filename) [FUNCTION] ;;; ;;; LINES-TO-HASH (lines) [FUNCTION] ;;; given the list of lines (as from csv-to-lines) stores the data ;;; in a hash table, which it returns, along with the header. ;;; ;;; CSV-TO-HASH (filename) [FUNCTION] ;;; ;;; ADD-COL (dt colname coldata) [FUNCTION] ;;; add-col (dt colname coltype coldata) -- add the column to dtable dt. ;;; PROBLEMS: ;;; -- Ensure that colname is unique, modify if needed. Return ;;; colname. -- doesn't handle case if length of coldata doesn't match ;;; rest of table...should tack nils everywhere to round out the table? ;;; ;;; ADD-OBS (dt obsdata) [FUNCTION] ;;; add-obs (dt obsdata) -- add the observation to the end of the dtable ;;; dt ;;; ;;; DEL-COL (dt colname) [FUNCTION] ;;; del-col (dt colname) -- delete the column colname from dtable dt. ;;; ;;; NOBS (dt) [FUNCTION] ;;; nobs (dt) -- return number of observations in table dt. ;;; Should return nil if table not found!! ;;; ;;; DTABLE-EXPORT (dt filename) [FUNCTION] ;;; writes dtable to filename as csv file ;;; ;;; DTABLE-IMPORT (filename) [FUNCTION] ;;; reads filename and loads it into a dtable struct which it returns ;;; ;;; ;;; GROUP (table grpcols) [FUNCTION] ;;; group (table grpcols) -- group the dtable structure by cols, ;;; save the group hash in the structure and return it. ;;; Note: grpcols can be functions of the columns. ;;; eg (group dt '((> sorate 5)(< 100000 salary))) ;;; ;;; GET-GROUP (dt grpcols) [FUNCTION] ;;; ;;; GET-GROUP-IDS (dt grpcols) [FUNCTION] ;;; ;;; DT-PROJECT-BY (dt expr by &key where) [FUNCTION] ;;; -- get the expression from the dtable dt by the by argument ;;; (which may be an expression). Returns a hash of lists of column data. ;;; This is very slow for long lists with both by and where conditions. ;;; ;;; DT-PROJECT2 (dt expr &key by where) [FUNCTION] ;;; dt-project (dt expr &key by where) -- get the expression from the ;;; dtable dt, return a list of column data. This clearly should be a ;;; macro. This wastes alot of time hiding and unhiding stuff ;;; ;;; DT-PROJECT-COLS (dt exprs &key by where) [FUNCTION] ;;; dt-project-cols (dt exprs &key by where) -- get the expressions ;;; from the dtable dt, return a list of lists of column data in the ;;; form ((col1)(col2)...(coln)). ;;; ;;; GET-COL (dt col &optional (convert t)) [FUNCTION] ;;; get-col (dt col &optional (convert t)) -- get the column from the ;;; dtable dt, return a list of column data. if convert nil, then don't ;;; try to convert the data to numeric ;;; ;;; GET-COLS (dt cols) [FUNCTION] ;;; get-cols (dt cols) -- get the columns from the dtable dt, ;;; return a list of column data. Need to add the by and where keys ;;; ;;; GET-COL-BY (dt col grpcols) [FUNCTION] ;;; get-col-by (dt col grpcols) -- group data by grpcols, ;;; return the hash with keys of group ids, values are the values ;;; of the column col in each group. ;;; ;;; GET-STATS-BY (dt col grpcols) [FUNCTION] ;;; get-stats-by (dt col grpcols) -- group data by grpcols, ;;; return the hash with keys of group ids, values are the stats of the ;;; values of the column col in each group. ;;; ;;; GET-OBS (dt n) [FUNCTION] ;;; get the nth observation (all columns) from the dtable as a list ;;; Should signal an error when past eof! ;;; ;;; JOIN (dta dtb match-cols keep-cols [FUNCTION] ;;; &optional (drop-multiple '(t t)) (keep-nomatch ' ;;; (nil nil))) ;;; join tables a and b on matching columns. Output a dtable ;;; with columns in the keep-cols lists. Match-cols is a list of pairs, ;;; keep-cols is a pair of lists. ;;; ;;; FORMULA-COL (dt fn cols) [FUNCTION] ;;; formula-col (dt fn cols) -- apply fn to the column list cols in dt, ;;; return a single vector whose length is (length dt), so to speak. ;;; ;;; BYGROUPS (dt) [FUNCTION] ;;; bygroups (dt) -- return a list of the names of the groups that exist ;;; for dtable dt ;;; ;;; GROUPKEYS (dt) [FUNCTION] ;;; groupkeys (dt) -- print the keys of the groups, and return a list ;;; of every key inside each group ;;; ;;; REHIDE (dt seq) [FUNCTION] ;;; rehide (dt seq) -- reset hidden obs to previously hidden set ;;; ;;; SELECT-ALL (dt) [FUNCTION] ;;; select-all (dt) -- clear any hidden obs and set all obs active ;;; ;;; HIDE (dt test &key (extend nil) (if-not nil)) [FUNCTION] ;;; hide (dt test &key extend) -- set the hidden field for the ;;; observations where the test evaluates true. Use nset-difference with ;;; DATOURA-OBSERVATION-NUMBER to get the complement. ;;; If keyword arg :extend is true, add cut obs to cut list, otherwise ;;; replace the cut list. ;;; ;;; DTABLE-SORT (dt collist &optional template) [FUNCTION] ;;; dtable-sort (dt collist) -- sort the table according to the ;;; columns in collist ascending or descending ;;; ;;; PRINT-DTABLE (dt s lev) [FUNCTION] ;;; print-dtable (dt s lev) This needs to get alot nicer. ;;; First, it should use the (dtable-active dt) list to decide which ;;; elements to print. Also, isn't there a built-in way to abbreviate ;;; the printing of a list? ;;; DATOURA[125]> (create-user-manual "plot.lsp") ;;; ;;; *SCATTER-PLOT-OPTIONS* ('((join))) [PARAMETER] ;;; ;;; *FUN-PLOT-OPTIONS* ('((join . t))) [PARAMETER] ;;; ;;; *PARAMETRIC-PLOT-OPTIONS* ('((join . t))) [PARAMETER] ;;; ;;; *HISTOGRAM-OPTIONS* ('nil) [PARAMETER] ;;; ;;; *PROFILE-OPTIONS* ('nil) [PARAMETER] ;;; ;;; *BAR-GRAPH-OPTIONS* ('nil) [PARAMETER] ;;; ;;; BAR-GRAPH (seq &key (barwidth 0.95) (offset 0) name fill color [FUNCTION] ;;; options) ;;; return a list of graphics objects describing the bar-graph ;;; seq is of the form (('x1' yval) ('x2' yval) ...) ;;; Needs to do some sanity-checking!!! ;;; Options include min max binwidth xlabel ylabel title ;;; (needs: ymax logy color fill linetype) ;;; ;;; FUN-PLOT (func xmin xmax &key dx (npoints 200) ymin ymax [FUNCTION] ;;; (join t) (symbol :smpt) ...) ;;; return a list of graphics objects describing the function plot. ;;; Options include ... ;;; ;;; HISTOGRAM (seq &key binwidth fill color name normalize stats [FUNCTION] ;;; line dash ...) ;;; return a list of graphics objects describing the histogram ;;; Options include min max binwidth xlabel ylabel title ;;; (needs: ymax logx logy axis color fill linetype) ;;; ;;; MAKE-PLOT-AXES (xmin ymin xmax ymax &optional (options nil)) [FUNCTION] ;;; make-plot-axes (xmin ymin xmax ymax &optional (options ())) -- makes ;;; the plot axes and returns the glist ;;; ;;; MAXAMILLION (seq xrng yrng &optional (n 300)) [FUNCTION] ;;; to prevent scatter plots from getting too big ;;; called 'maxamillion' since it limits number of points (optionally) ;;; to a million ;;; ;;; PARAMETRIC-PLOT (xfunc yfunc tlist &key xmin xmax ymin ymax [FUNCTION] ;;; (join t) (symbol :smpt) ...) ;;; return a list of graphics objects describing the parametric plot. ;;; Options include ... ;;; ;;; PROFILE (seq &key binwidth (offset 0) name stats name xmin xmax [FUNCTION] ;;; ymin ...) ;;; return a list of graphics objects describing the profile. ;;; seq is of the form: ((x1 y1) (x2 y2) ...) ;;; Options include ... ;;; ;;; SCATTER-PLOT (seq &key color xmin xmax ymin ymax join [FUNCTION] ;;; (symbol :mdpt) name ...) ;;; return a list of graphics objects describing the scatter plot. ;;; seq is of the form: ((x1 y1) (x2 y2) ...) ;;; Options include ... ;;; (IN-PACKAGE DEFPACKAGE UNLESS PRINT) DATOURA[126]> (create-user-manual "graphics.lsp") ;;; ;;; *POSTSCRIPT-VIEWER* ("gv -spartan") [PARAMETER] ;;; The postscript viewer program ;;; ;;; *GV-PID* (nil) [PARAMETER] ;;; The process id of the postscript viewer ;;; ;;; SET-GRAPHICS-PATH (path) [FUNCTION] ;;; ;;; *GRAPHICS-OPTIONS* (`((xsize . ,(* 0.8 480)) (ysize . , [PARAMETER] ;;; (* 0.8 296)) (axes :x0 :y0) (show-axes . t) ;;; (margin (:rx 0 1) (:ry 0 1)))) ;;; ;;; *TEXT-OPTIONS* ('((text-angle . 0) (text-justification . left) [PARAMETER] ;;; (text-size . 15))) ;;; ;;; *POINT-OPTIONS* ('((point-symbol . :mdpt))) [PARAMETER] ;;; ;;; *PS-OPTIONS* ('(nil)) [PARAMETER] ;;; ;;; *LINE-OPTIONS* ('((coords . axis))) [PARAMETER] ;;; ;;; *CIRCLE-OPTIONS* ('(nil)) [PARAMETER] ;;; ;;; *POLYGON-OPTIONS* ('((fill))) [PARAMETER] ;;; ;;; *DIAMOND-OPTIONS* ('((diamond-command . "diamond"))) [PARAMETER] ;;; ;;; *RECTANGLE-OPTIONS* ('((rec-type) (coords . axis))) [PARAMETER] ;;; ;;; *DEFAULT-MARGIN* ('(0.15 0.85)) [PARAMETER] ;;; ;;; *GLIST-PRINT-LENGTH* (10) [PARAMETER] ;;; ;;; *TINY-NUMBER* ((* 1000 least-positive-short-float)) [CONSTANT] ;;; Extent of a point in datoura space. I don't know why it has to be so ;;; big. ;;; ;;; *DEFAULT-MAJOR-TICKS* (8) [CONSTANT] ;;; How many tick marks to try to put on an axis ;;; ;;; *MAJOR-TICK-LEN* (7) [CONSTANT] ;;; ;;; *MINOR-TICK-LEN* (5) [CONSTANT] ;;; ;;; *AXIS-OPTIONS* ('((label-precision . 4))) [PARAMETER] ;;; ;;; *AXIS-MARKER-FONT* ("swiss-small") [PARAMETER] ;;; ;;; *X-MARKER-JUSTIFICATION* (:center-top) [PARAMETER] ;;; ;;; *Y-MARKER-JUSTIFICATION* (:right-center) [PARAMETER] ;;; ;;; *LEGEND-OPTIONS* ('((leg-xpos . 0.18) (leg-ypos . 0.9) [PARAMETER] ;;; (leg-dx . 0) (leg-dy . -0.05) ;;; (leg-font . "8 fixed-n"))) ;;; ;;; *PLOT-COUNTER* (0) [PARAMETER] ;;; ;;; *CURRENT-PLOT* (0) [PARAMETER] ;;; ;;; GR-OBJ-PRINT (gobj s lev) [FUNCTION] ;;; gr-ojb-print (gobj s lev) ;;; ;;; GRAPHICS-OBJECT (type location coords value options bbox [STRUCTURE] ;;; display-fn) ;;; graphics-object -- The structure to contain graphics primitives, such ;;; as points, lines, text etc ;;; ;;; COPY-GRAPHICS-OBJECT (obj) [FUNCTION] ;;; copy-graphics-object (obj) -- returns a 'deep copy' of the graphics ;;; object obj. This allows manipulation of co-ordinates of the copy ;;; without affecting the original. Otherwise, a glist can only be scaled ;;; once. ;;; ;;; GLIST (lst) [STRUCTURE] ;;; ;;; COPY-GLIST (obj) [FUNCTION] ;;; copy-glist (obj) -- returns a 'deep copy' of the glist ;;; This allows manipulation of co-ordinates of the copy ;;; without affecting the original. Otherwise, a glist can only be scaled ;;; once. ;;; ;;; GLIST-PRINT (gl s lev) [FUNCTION] ;;; ;;; GLIST-NCONC (&rest objs) [FUNCTION] ;;; glist-nconc (&rest objs) -- returns glist object of objs, whether ;;; they are glists, lists of or atomic gr-objs. This is a faster, ;;; destructive version of glist-append ;;; ;;; GLIST-APPEND (&rest objs) [FUNCTION] ;;; glist-append (&rest objs) -- returns glist object of objs, whether ;;; they are glists, lists of or atomic gr-objs ;;; ;;; GLIST-PUSH (gl &rest new-objs) [MACRO] ;;; glist-push (gl &rest new-objs) -- push graphics objects on ;;; THE BEGINNING of gl ;;; ;;; GLIST-ADD (gl &rest new-objs) [MACRO] ;;; glist-add (gl &rest new-objs) -- adds graphics objects TO THE END of ;;; gl ;;; ;;; AXIS-OBJECT (name label min max transform-fn angle location [STRUCTURE] ;;; margin major-ticks major-offset ...) ;;; axis-object -- The structure to contain description of an axis ;;; ;;; AXIS-EXP (min max) [FUNCTION] ;;; axis-exp (min max) -- Calculate the power of 10 to scale the ;;; axis labels by in order to keep them between .001 and 10000 ;;; ;;; CALC-MAJOR-TICKS (min max &key (nticks *default-major-ticks*)) [FUNCTION] ;;; defun calc-major-ticks (min max &key (nticks *default-major-ticks*)) ;;; -- Calculate the major tick spacing for the axis with range min to ;;; max trying to get nticks tick marks. The spacing will be a round ;;; number beginning with 1,2 or 5 ;;; ;;; AXIS-TICK-LINES (begin location angle tick-len) [FUNCTION] ;;; ;;; AXIS-TICK-LOCATIONS (obj) [FUNCTION] ;;; axis-tick-locations (obj) -- return a list of points where ;;; to start the ticks from, suitable for showing with line. ;;; ;;; MAKE-AXIS-GLIST (axobj &optional (options nil)) [FUNCTION] ;;; make-axis-glist (axobj &optional (options ())) -- Make a glist, ;;; suitable for showing with show, that will draw the axis-object axobj ;;; ;;; SET-COLOR (color) [FUNCTION] ;;; ;;; UNSET-COLOR "()" [FUNCTION] ;;; ;;; GRESTORE "()" [FUNCTION] ;;; ;;; AXIS-SETTING (name &key label location major-ticks [FUNCTION] ;;; n-minor-ticks marker-label-fn options) ;;; create a graphics-object that will be used to modify the axis with ;;; name 'name' after graphics-compile ;;; ;;; MAKE-LEGEND-GLIST (gl &optional (options nil)) [FUNCTION] ;;; make-legend-glist (lst &optional (options ())) -- make a glist to ;;; show the legend entries ;;; ;;; LEGEND-ENTRY (label &key (symbol :smsqe) (rgbcolor '(0 0 0))) [FUNCTION] ;;; legend-entry (name &key symbol rgbcolor label) -- Create a graphics ;;; object as an element to the plot legend ;;; ;;; STRETCH-POINT (x y &optional (options nil)) [FUNCTION] ;;; return a graphics object invisible point which will reserve space ;;; on the axes, but will not be shown ;;; ;;; POINT (x y &optional (options nil)) [FUNCTION] ;;; return a graphics object point suitable for use in show. ;;; ;;; SHOW-POINT (strm gelem) [FUNCTION] ;;; write a ps description of a point to str ;;; ;;; PS-DIRECTIVE (value &optional options) [FUNCTION] ;;; create a graphics object that passes a postscript string directly ;;; to the output file. ;;; ;;; SHOW-PS-DIRECTIVE (strm gelem) [FUNCTION] ;;; pass the postscript directive to the output stream ;;; ;;; LINE (vtx-list &optional (options nil)) [FUNCTION] ;;; return a graphics object polyline suitable for use in show. ;;; ;;; SHOW-LINE (strm gelem) [FUNCTION] ;;; write a ps description of a polyline to str ;;; ;;; CIRCLE (x y r &optional (options nil)) [FUNCTION] ;;; return a graphics object circle suitable for use in show. ;;; ;;; SHOW-CIRCLE (strm gelem) [FUNCTION] ;;; write a ps description of a circle to strm ;;; ;;; POLYGON (vtx-list &optional (options nil)) [FUNCTION] ;;; valid option: fill default non fill. ;;; return a graphics object polygon suitable for use in show. ;;; ;;; SHOW-POLYGON (strm gelem) [FUNCTION] ;;; write a ps description of a polygon to str ;;; ;;; RECTANGLE (xywh &optional (options nil)) [FUNCTION] ;;; return a graphics object rectangle suitable for use in show. ;;; corners are of form ((llx lly) (width height)) which is ;;; natural for postscript. ;;; ;;; SHOW-RECTANGLE (strm gelem) [FUNCTION] ;;; write a ps description of a rectangle to str ;;; ;;; TEXT (x y text &optional (options nil)) [FUNCTION] ;;; return a graphics object text suitable for use in show. ;;; ;;; SHOW-TEXT (strm gelem) [FUNCTION] ;;; ;;; DIAMOND (xywh &optional (options nil)) [FUNCTION] ;;; return a graphics object diamond suitable for use in show. ;;; ;;; SHOW-DIAMOND (strm gelem) [FUNCTION] ;;; write a ps description of a diamond to strm ;;; ;;; GRAPHICS-COMPILE (gl &optional (options nil)) [FUNCTION] ;;; determine the min and max of the x and y axis for axis co-ordinate ;;; systems. Return (xfactor xoffset yfactor yoffset) ;;; ;;; SCALE-AXES (bbox-hash xsz margin angle) [FUNCTION] ;;; scale-axes (bbox-hash xsize margin angle) -- return an alist of ;;; closures that will linearly scale axes according to the window size ;;; and bounds ;;; ;;; GRAPHICS-TRANSFORM (gl &optional (gaxes (nil nil nil nil)) [FUNCTION] ;;; (options nil)) ;;; set the locations of all objects in gl to absolute co-ordinates. ;;; ;;; SHOW (gr-list &optional (options nil)) [FUNCTION] ;;; show (gr-list &optional (options ())) -- compile the graphics ;;; directives in glist and write the output to *graphics-terminal* ;;; ;;; OPEN-TERMINAL "()" [FUNCTION] ;;; open-terminal () -- This routine is clisp/linux specific. It opens ;;; the postscript viewer. returns *gv-pid* ;;; ;;; REFRESH-TERMINAL "()" [FUNCTION] ;;; refresh-terminal () -- refresh the terminal. This works for gv by ;;; sending a HUP signal to gv. ;;; ;;; LINK-TERMINAL (pnum) [FUNCTION] ;;; ;;; FFWD (&optional (n 1)) [FUNCTION] ;;; ;;; REWIND (&optional (n 1)) [FUNCTION] ;;; ;;; SHOW-CURRENT "()" [FUNCTION] ;;; ;;; GRAPHICS-DISPLAY (gl &optional (options nil)) [FUNCTION] ;;; (SET-GRAPHICS-PATH LOAD SETF IN-PACKAGE DEFPACKAGE UNLESS) DATOURA[127]> (create-user-manual "utils.lsp") ;;; ;;; ? (fun) [FUNCTION] ;;; ? (fun) -- print the documentation string for function fun ;;; ;;; ABBREV (short long) [MACRO] ;;; from Paul Graham's On Lisp, p 214 ;;; ;;; ABBREVS (&rest names) [MACRO] ;;; from Paul Graham's On Lisp, p 214 ;;; ;;; ALIST-JOIN (alist blist) [FUNCTION] ;;; prepend assoc list a to assoc list b. ;;; If alist is a single element like '(q . r) then cons it to the ;;; list, otherwise append blist to alist ;;; ;;; ASC-DESC-P (a b fnlist) [FUNCTION] ;;; predicate for sorting lists by ;;; ascending or descending columns, controlled by fnlist. ;;; Also -- handle character comparison! ;;; ;;; ASSOC-VAL (key alist) [FUNCTION] ;;; retrieve the value of the alist with key, ;;; instead of the pair. return nil if key not in alist ;;; ;;; CATEGORY-FREQ (seq) [FUNCTION] ;;; categorical frequencies. ;;; ;;; CDF (seq &key normalize) [FUNCTION] ;;; return a list of pairs of x y values ;;; describing the cumulative distribution of the sequence. ;;; ;;; CEILING-TO-NEAREST (num precision) [FUNCTION] ;;; round num up to the next value evenly divisible by precision. ;;; Works best if precision is a rational! ;;; ;;; *DBG-IDS* (nil) [VARIABLE] ;;; Identifiers used by dbg ;;; ;;; DBG (id format-string &rest args) [FUNCTION] ;;; Print debugging info if (DEBUG ID) has been specified. ;;; ;;; DEBUG-ON (&rest ids) [FUNCTION] ;;; Start dbg output on the given ids. ;;; ;;; DEBUG-OFF (&rest ids) [FUNCTION] ;;; Stop dbg on the ids. With no ids, stop dbg altogether. ;;; ;;; DBG-INDENT (id indent format-string &rest args) [FUNCTION] ;;; Print indented debugging info if (DEBUG ID) has been specified. ;;; ;;; DEGTORAD (deg) [FUNCTION] ;;; convert degrees to radians ;;; ;;; DEPTH (tree &optional (d0 1)) [FUNCTION] ;;; return depth of deepest node in tree ;;; ;;; ELT-0 (seq) [FUNCTION] ;;; Sequence analog to list function first ;;; ;;; ELT-1 (seq) [FUNCTION] ;;; Sequence analog to list function second ;;; ;;; EXTRACT (seq elems) [FUNCTION] ;;; Return the elements of seq which appear ;;; in the sequence elems ;;; ;;; FLATTEN (tree &optional (level 0)) [FUNCTION] ;;; modified from Essential Lisp, Anderson,Corbett, ;;; Reiser p. 149. Added level option -- i'm not sure this really does ;;; what it should...should it flatten from top or bottom? ;;; ;;; FLATTEN-FULL (tree) [FUNCTION] ;;; taken from On Lisp, Graham, p390. ;;; ;;; FLOOR-TO-NEAREST (num precision) [FUNCTION] ;;; round num down to the next value evenly divisible by precision. ;;; Works best if precision is a rational! ;;; ;;; FREQUENCIES (seq binwidth &key normalize) [FUNCTION] ;;; return a list of pairs of (binedge, count) pairs based on data seq. ;;; If normalized, then return pairs of (binedge, probability). It would ;;; be nice to have this work for ;;; character sequences also ;;; ;;; GROUPLIST (source n) [FUNCTION] ;;; from Paul Graham's group, On Lisp, p 47 return source list in ;;; sublists of length n ;;; ;;; HASH-PIPE (hash depth keys) [STRUCTURE] ;;; A hash data structure with a maximum number of keys. Attempts ;;; to put more than keys into the hash-pipe delete the ;;; oldest key. A key's age is reset every time it is accessed. ;;; ;;; HASH-PIPE-RELOAD (key name) [FUNCTION] ;;; Set 's most recently accessed key to argument. ;;; ;;; GETHASH-PIPE (key name) [FUNCTION] ;;; hash-pipe's version of gethash ;;; ;;; HASH-PIPE-UPDATE (key name value) [FUNCTION] ;;; Internal function used by defsetf ;;; ;;; (SETF GETHASH-PIPE) hash-pipe-update [SETF MAPPING] ;;; ;;; IN (obj &rest choices) [MACRO] ;;; return t if obj is in choices, else () ;;; From Graham's 'Common Lisp' ;;; ;;; INTERSECT-SVEC (vlong vshort) [FUNCTION] ;;; ;;; KEYS (h) [FUNCTION] ;;; return the keys of a hash ;;; ;;; KILL-NIL (seq &optional (level 0)) [FUNCTION] ;;; return seq without nils at top or first level ;;; and the number of nils removed. A recursive version could handle ;;; any depth, but i'm not in the mood to do it right now. ;;; ;;; LIST-ASC-P (a b) [FUNCTION] ;;; predicate to sort lists ascending element-by-element ;;; ;;; LIST-DESC-P (a b) [FUNCTION] ;;; predicate to sort lists descending element-by-element ;;; ;;; LIST-ORDER (a b fn) [FUNCTION] ;;; return true if list a is (whatever fn says) of list b, on an ;;; element-by-element comparison. ;;; ;;; LIST-SORT-ASC-DESC (seq fnlist &optional tmpl) [FUNCTION] ;;; sort a sequence of lists by ascending or descending order. ;;; eg. (list-sort-asc-desc '(((1 4 3) (2 3 5) (1 3 2) (2 3 8)) '(< >)) ;;; tmpl is the template, eg. '(1 's 1) will sort using < string-lessp ;;; <. If tmpl is not provided, use the first element in seq. ;;; ;;; LONGEST-BRANCH (tree) [FUNCTION] ;;; return the length of the longest (first level) branch in tree ;;; ;;; LONGEST-OF-2 (x y) [FUNCTION] ;;; return the length of the longest (first level) branch in tree ;;; ;;; MAC (expr) [MACRO] ;;; ;;; MKRANDLIST (n mx lis) [FUNCTION] ;;; ;;; MAKE-RANDOM-LIST (n &optional (mx 1.0) (lis nil)) [FUNCTION] ;;; Generate a list of random numbers from 0 to mx. ;;; ;;; MAPSTRETCH-2 (fn lst1 lst2) [MACRO] ;;; ;;; MAPSTRETCH (fn &rest lsts) [MACRO] ;;; ;;; MKLIST (obj) [FUNCTION] ;;; ;;; NAME-OF (x y) [FUNCTION] ;;; return true if x and y are symbols with the same name. ;;; This is required when using symbols as options across packages. ;;; ;;; NTH-OR-LAST (seq n) [FUNCTION] ;;; return the nth element of seq, or the last if n is past the end of ;;; seq ;;; ;;; POSITIONS (test seq) [FUNCTION] ;;; return a list of all of the positions (at the top level) ;;; in seq where test is true. ;;; ;;; PRINT-HASH (h &optional (str t)) [FUNCTION] ;;; recursively print the key-value pairs of a hash. Needs indentation ;;; levels to separate ;;; ;;; PRINT-KEYS (h) [FUNCTION] ;;; print the keys of a hash ;;; ;;; RANGE (n &optional (mx nil) (inc 1)) [FUNCTION] ;;; generate numbers spaced by inc from 0 to n (inclusive) or, if mx is ;;; not nil, from n to mx (inclusive) ;;; ;;; ROUND-TO-NEAREST (num precision) [FUNCTION] ;;; round num to the nearest value evenly divisible by precision. ;;; Works best if precision is a rational! ;;; ;;; ROUND-TO-NEAREST-POINT (pair &optional (x 1/1000) (y 1/1000)) [FUNCTION] ;;; Round a point to the nearest point in space divisible by x y. ;;; ;;; SET-DIFF-SVEC (vlong vshort) [FUNCTION] ;;; return sequence of elements in vlong that are NOT in vshort. Both ;;; vectors must be sorted before calling. ;;; ;;; SIMPLE-STATS (seq) [FUNCTION] ;;; return an assoc-list of stats for all numerical ;;; elemens in seq (n,mean,rms,min,max) (character elements. ?) ;;; note: the sigma returned here is the standard deviation as defined ;;; by sqrt( sum_i (1/n * (x_i - x_mean)^2))...some people use n-1 ;;; instead of n also -- i added features form handling strings, but this ;;; really will mess things up for mixed columns. ;;; ;;; SORT-COPY (seq test) [FUNCTION] ;;; return a sorted copy of seq, without destroying seq ;;; ;;; SORT-IN-PLACE (seq test) [MACRO] ;;; sort seq in place. ;;; ;;; COMMAP (c) [FUNCTION] ;;; ;;; WHITESPACEP (c) [FUNCTION] ;;; ;;; TOKENS (str &optional (test #'whitespacep) (start 0)) [FUNCTION] ;;; Taken from Paul Graham's Common Lisp, 'tokens' p 67. ;;; tokens (str &optional (test #'whitespacep) (start 0)) ;;; split a string into tokens. ;;; ;;; SPLIT-STRING (str &optional (test #'whitespacep)) [FUNCTION] ;;; derived from 'tokens' ;;; split-string (str &optional (test #'whitespacep)) ;;; split a string into tokens. ;;; ;;; STRETCH-LIST (lis len) [FUNCTION] ;;; ;;; THREAD-LISTS (lists) [FUNCTION] ;;; a la mathematica... ;;; ;;; THREAD (&rest cols) [FUNCTION] ;;; a la mathematica... ;;; ;;; TYPE-SEQ (seq) [FUNCTION] ;;; ;;; DEFUN-MEMO (fn args &body body) [MACRO] ;;; Define a memoized function. ;;; ;;; MEMO (fn &key (key #'first) (test #'eql) name depth) [FUNCTION] ;;; Return a memo-function of fn. ;;; ;;; MEMOIZE (fn-name &key (key #'first) (test #'eql) (depth 20)) [FUNCTION] ;;; Replace fn-name's global definition with a memoized version. ;;; ;;; CLEAR-MEMOIZE (fn-name) [FUNCTION] ;;; Clear the hash table from a memo function. ;;; ;;; DELAY (value computed?) [STRUCTURE] ;;; ;;; DELAY (&rest body) [MACRO] ;;; A computation that can be executed later by FORCE. ;;; ;;; FORCE (delay) [FUNCTION] ;;; Do a delayed computation, or fetch its previously-computed value. ;;; (IN-PACKAGE DEFPACKAGE) DATOURA[128]> (create-user-manual "datoura.lsp") ;;; ;;; DATOURA-SESSION-ID "()" [FUNCTION] ;;; session-id () -- returns a string that identifies a datoura session ;;; based on the date and time. Should be unique, but this isn't ;;; guaranteed. ;;; ;;; BYE "()" [MACRO] ;;; ;;; EXIT "()" [MACRO] ;;; ;;; *BASE-PATH* ((ensure-directories-exist [PARAMETER] ;;; (pathname ;;; (concatenate 'string ;;; (namestring (user-homedir-pathname)) ;;; ".datoura-sessions/" *datoura-session-id* "/")))) ;;; ;;; CLEANUP "()" [FUNCTION] ;;; cleanup () -- clean up the files created by this session... ;;; ;;; PLOT-CDF (dt expr &key by where (colors (cdr colorlist)) [FUNCTION] ;;; (symbol :mdsqe) join options) ;;; hist+cdf plot (by byvar). ;;; ;;; SCATTER-BY (dt expr by &key where (colors (cdr colorlist)) [FUNCTION] ;;; (symbol :mdsqe) options) ;;; scatter plot by byvar. ;;; (SETF DATOURA-GRAPHICS::SET-GRAPHICS-PATH IN-PACKAGE DEFPACKAGE LOAD EXPORT UNLESS) DATOURA[129]> (dribble) ;; Dribble of # finished 2004-10-04 18:41:24