Common Lisp Package: POD-UTILS

README:

FUNCTION

Public

BEFORE (X Y LST &KEY (TEST #'EQL))

Returns like member when x before y.

BREAK-LINE-AT (STRING BREAK-BAG POSITION)

Return the argument STRING with linefeeds inserted at some position past POSITION where a character in the break-bag is encountered.

C-NAME2LISP (C-STRING)

aNameLikeThis --> a-name-like-this

CHOP (STR)

Like perl.

CLEAR-MEMOIZE (FN-NAME)

Clear the hash table from a memo function.

DEBUG-MEMO (FN NAME KEY TEST)

Like memo but prints *hit* on every hit.

DUPLICATE (OBJ LST &KEY (TEST #'EQL))

Returns like member when a second copy of obj is in lst. > (duplicate 'a '(a b c a d) ==> (A D)

FAIL (ARG)

Useful in tree searches, when you want to navigate the entire tree.

FIND2 (FN LST)

Like find but returns value from function too.

FLATTEN (INPUT &OPTIONAL ACCUMULATOR)

Return a flat list of the atoms in the input. Ex: (flatten '((a (b (c) d))) => (a b c d))

INTERSECT-PREDICATES (FN &REST FNS)

Paul Graham's. Return a predicate which is the AND of the arguments.

KINTERN (STRING &REST ARGS)

Apply FORMAT to STRING and ARGS, upcase the resulting string and intern it into the KEYWORD package.

LISP-NAME2C (IN-STRING &AUX (LISP-STRING (STRING-DOWNCASE IN-STRING)))

a-name-like-this --> aNameLikeThis

LOAD-HT (HT KEY-VALUE-PAIRS)

Load the argument hash table with the argument values provided in a flat list of <key> <value>.

LONGER (X Y)

Return true if x longer than y -- only for lists.

MEMO (FN NAME KEY TEST)

Return a memo-function of fn.

MEMOIZE (FN-NAME &KEY (KEY #'FIRST) (TEST #'EQL) (DEBUG NIL))

Replace fn-name's global definition with a memoized version.

MKLIST (OBJ)

Make the argument a list if it isn't already.

NAME2INITIALS (STRING)

For 'abc' return 'a'. For 'product_definition_formation' return 'pdf', etc.

PREPEND (X Y)

Prepend y to start of x

PRUNE (TEST TREE)

(prune #'oddp '(1 2 (3 4) (5 6 (7 8 (9 10 (11)) 12) 13))) ==> (2 (4) (6 (8 (10 NIL) 12)))

REMOVE-EXTRA-SPACES (STRING)

Leave only one space between non-space characters of argument string.

REUSE-CONS (X Y X-Y)

Return (cons x y), or just x-y if it is equal to (cons x y).

SINGLE-P (LST)

List contains just one thing.

SINTERN (STRING &REST ARGS)

Apply FORMAT to STRING and ARGS, upcase the resulting string and intern it into the current (*PACKAGE*) package.

SPLIT (STRING C &KEY MIN-SIZE)

Like the perl split, split the string using the character. Return a list of substrings.

SPLIT-IF (FN LST)

Splits a list into two where fn returns true. (split-if #'(lambda (x) (> x 4)) '(1 2 3 4 5 6 7) ==> (1 2 3 4) (5 6 7)

SUBSTRING (STR1 STR2)

Returns the place in str1 where str2 begins or nil if str2 is not in str1

Undocumented

COMBINATIONS (&REST SETS)

DECODE-TIME-INTERVAL (TIME)

GROUP (SOURCE N)

MAPAPPEND (FUN &REST ARGS)

PAIRS (INLIST)

READ-STRING-TO-LIST (STRING)

SYSTEM-ADD-MEMOIZED-FN (FNAME)

SYSTEM-CLEAR-MEMOIZED-FNS

SYSTEM-FORGET-MEMOIZED-FNS

SYSTEM-LIST-MEMOIZED-FNS

Private

AFTER (X Y LST &KEY (TEST #'EQL))

Returns like member when x after y. x must be in y.

DEPTH-SEARCH-TRACKING (GOAL-P SUCCESSORS DO)

Search depth-first, return path when successful.

MACROEXPAND-ALL (FORM &OPTIONAL ENV)

Macroexpand FORM recursively until none of its subforms can be further expanded.

POPHASH (OBJECT HT)

Remove the value and return it>

RESLIST-ARR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

RESLIST-FILLPTR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

RESLIST-RESIZE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

RESLIST-STOCK-FN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

BACKOUT

CALL-COUNT-IT (&REST KEYS)

CALL-TRC (STREAM S &REST OS)

COPY-RESLIST (INSTANCE)

LAST1 (LST)

MAKE-RESLIST (&KEY ((FILLPTR DUM927) 0) ((RESIZE DUM928) 2.0) ((STOCK-FN DUM929) NIL) ((ARR DUM930) NIL))

MAPNCONC (FUN &REST ARGS)

NEW-RESLIST (SIZE &KEY (ELEMENT-TYPE T) (RESIZE 2.0) STOCK-FN)

NOW

SETFRESLIST-ARR (NEW-VALUE INSTANCE)

SETFRESLIST-FILLPTR (NEW-VALUE INSTANCE)

RESLIST-P (OBJECT)

RESLIST-POP (RESLIST)

RESLIST-PUSH (VAL RESLIST)

SETFRESLIST-RESIZE (NEW-VALUE INSTANCE)

SETFRESLIST-STOCK-FN (NEW-VALUE INSTANCE)

SET-SEARCH-PATH (VAL)

TREE-SEARCH-PATH

UTILS-KT-RESET

MACRO

Public

SETX (VAR VAL)

For use at toplevel to avoid annoying stuff from sbcl and cmucl.

UPDATE (PLACE OBJECT &KEY (KEY '#'IDENTITY) (TEST '#'EQL))

Argument object may have same key as another in the list. If so, replace it with the argument. If not, push it. Only replaces first found. (Keys are assumed to be unique).

WHEN-BIND ((VAR EXPR) &BODY BODY)

Paul Graham ON LISP pg 145. when+let

WHEN-BIND* (BINDS &BODY BODY)

Paul Graham ON LISP pg 145. when+let*

Undocumented

DBIND (VARS FORM &BODY BODY)

DEFMEMO (FNAME &BODY BODY)

DEFUN-MEMOIZE (FN ARGS &BODY BODY)

IF-BIND ((VAR EXPR) THEN ELSE)

MAC (MACRO)

MAC2 (MACRO)

MVS (VARS FORM &BODY BODY)

PPRINT-WITHOUT-STRINGS (&BODY BODY)

STRCAT (&REST STRINGS)

VARS (&REST VARIABLES)

WITH-STACK-SIZE ((SIZE) &BODY BODY)

Private

ENSURE-GETHASH (OBJECT HT DEFAULT)

Just like GETHASH with the default argument, but DEFAULT is only evaluated when OBJECT is not found and in that case the value of DEFAULT is placed into (GETHASH OBJECT HT).

MAP-IN (FN SEQ &REST SEQS)

`map-into' the first sequence, evaluating it once. (map-in F S) == (map-into S F S)

WITH-GENSYMS (SYMS &BODY BODY)

Paul Graham ON LISP pg 145. Used in macros to avoid variable capture.

Undocumented

COUNT-IT (&REST KEYS)

DEFINE-CONSTANT (NAME VALUE &OPTIONAL DOC)

PPRINT-SYMBOLS (&BODY BODY)

TRC (TGT-FORM &REST OS &AUX (WRAPPER (IF (MACRO-FUNCTION 'WITHOUT-C-DEPENDENCY) 'WITHOUT-C-DEPENDENCY 'PROGN)))

VARIABLE

Private

Undocumented

*COUNT*

*COUNTING*

*MEA-HOOKS*

*STOP*

*TRCDEPTH*

CLASS

Private

Undocumented

RESLIST