monkeylib-utilities

API Reference

com.gigamonkeys.utilities

Peter Seibel's collection of 'utilities'.

COM.GIGAMONKEYS.UTILITIES

  • Function MAKE-HEAP (&optional (initial-size 16))
  • Function HEAP-PUSH (value heap)
  • Function HEAP-PEEK (heap)
  • Function HEAP-POP (heap)
  • Function EMPTY-HEAP (heap)
  • Generic-Function HEAP> (a b)
  • Method HEAP> ((a number) (b number))
  • Method HEAP> ((a character) (b character))
  • Method HEAP> ((a string) (b string))
  • Macro WITH-SLOT-VALUES ((&rest names) object &body body)
  • Class DATE
    DAY   Accessor: DAY
    MONTH   Accessor: MONTH
    YEAR   Accessor: YEAR
  • Function DATE< (d1 d2)
  • Function DATE<= (d1 d2)
  • Function DATE>= (d1 d2)
  • Function DATE> (d1 d2)
  • Function DATE= (d1 d2)
  • Function DATE+ (d1 days)
  • Function DATE- (d1 days)
  • Function TODAY
  • Function YYYY-MM-DD (date)
  • Generic-Function DATE (value)
  • Method DATE ((value t))
  • Method DATE ((string string))
  • Method DATE ((utc integer))
  • Function MAKE-DATE (&key (defaults (today)) (year (year defaults)) (month (month defaults)) (day (day defaults)))
  • Function DATE->UTC (date)
  • Function MIDNIGHT (date)
  • Function DAY-OF-WEEK (date)
  • Function LEAP-YEAR-P (year)
  • Function DAYS-IN-MONTH (month year)
  • Function TOMORROW (date)
  • Function YESTERDAY (date)
  • Function NEXT-YEAR (date)
  • Function THIS-YEAR (date)
  • Function DAYS-BETWEEN (d1 d2)
  • Function NEXT-DAY (day-of-week)
  • Function PARSE-TIME (time)
    Parse a time of the form H:MM:SS or MM:SS into a number of seconds.
  • Function DUMP-FILE (file stream &key (element-type (stream-element-type stream)))
    Dump the contents of file to stream.
  • Function FILE-TEXT (pathname)
  • Function FILE-BYTES (file)
  • Function FILE-CHAR-LENGTH (file &key (external-format :utf-8))
    The length of the file in characters for a given external-format.
  • Function COPY-FILE (from to)
  • Function FILE->LINES (filename)
  • Function FILE->LIST (filename &optional (package *package*))
  • Function FILE->SEXP (filename &optional (package *package*))
  • Macro WITH-OUTPUT-TO-FILE ((out file &key (ensure-directories nil)) &body body)
    Write to a file, creating if it does not exist and superseding if it does. Returns the truename of the file created. If :ensure-directories is true, create parent directories too.
  • Macro WITH-DATA-IO-SYNTAX (&body body)
    Do i/o with standard io-syntax except with *print-case* bound to :downcase, *read-eval* bound to nil, and *package* the keyword package. Useful for more or less safely reading and writing data.
  • Macro WITH-DATA-TO-FILE ((out file &key (ensure-directories nil)) &body body)
    Write data to a file using data-io-syntax, appending to the file if it exists and creating it if necessary. If :ensure-directories is true, create parent directories too.
  • Macro WITH-LOCK-FILE ((filename) &body body)
    Simple minded technique for using the existence of a file as a locking mechanism to keep cooperative threads or processes from stomping on eachother.
  • Function MKLIST (x)
    `x' if it is a list, otherwise a singleton list containing `x'.
  • Function UNLIST (x)
    If `x' is a singleton list, the single item; otherwise `x'.
  • Macro DESTRUCTURING-DATA ((&rest tree) thing &body body)
    Destructure a list as with DESTRUCTURING-BIND except anywhere in the pattern that a keyword appears, the same keyword must appear in the data.
  • Function KEYWORDIZE (s)
    Return a keyword symbol with the name of the given string upcased.
  • Function ROUND-TO (number n &optional (rounding-function #'round))
    Round to nearest `n'. (round-to x 1) === (round x)
  • Function ! (n)
  • Function NSHUFFLE-VECTOR (vector)
    Shuffle a vector in place using Fisher-Yates algorithm.
  • Function SHUFFLE-VECTOR (vector)
    Return a shuffled copy of vector.
  • Function SHUFFLE-LIST (list)
    Return a shuffled copy of list. Based on a post by Ben Rudiak-Gould in comp.lang.functional, Message-ID: <j7o400l04cdn4oaihgcu9ats5r0eel3hg0@4ax.com>
  • Function RANDOM-SELECTION (list n)
  • Function MONTH-NAME (number)
  • Function DAY-NAME (number)
  • Function MAKE-TIME (&rest args &key second minute hour day month year zone (defaults (get-universal-time)))
  • Function MERGE-TIME (utc &key second minute hour day month year zone)
  • Function REVERSE-TRANSLATE-ZONE (zone)
  • Macro WITH-TIME ((&rest args) utc &body body)
  • Macro WITH-CURRENT-TIME ((&rest args) &body body)
  • Function FORMAT-ISO-8601-TIME (time-value &key time-zone omit-time-zone omit-date omit-time)
    Formats a universal time TIME-VALUE in ISO 8601 format. If no time zone is provided the default timezone returned by DECODE-UNIVERSAL-TIME, adjusted by daylights savings time as appropriate, is used. The time zone information is included in the generated string unless OMIT-TIME-ZONE is true. (In general, if you want a shorter string, rather than omit the timezone altogether it is better to pass an explicit time-zone argument of 0 (GMT) which will add only a single 'Z' to the string yet still produce an unambiguous date/time string.)
  • Function PARSE-ISO-8601-TIME (text)
  • Function ISO-8601-TIME-ZONE (name)
  • Function LISP-TIME-ZONE (name)
  • Function NOW
  • Function DATE/TIME->UTC (year month date &optional (hour 0) (minute 0) (second 0))
  • Function TIME->UTC (hour minute)
  • Function HH-MM-SS (seconds)
  • Function HH-MM (seconds)
  • Function HUMAN-TIME (seconds)
  • Function PARSE-DATE-STRING (string)
  • Function WEEKDAY-P (time)
  • Function UNIX-TIME (&optional (utc (get-universal-time)))

Also exports

  • ALEXANDRIA.0.DEV:ONCE-ONLY
  • ALEXANDRIA.0.DEV:NEGATIVE-LONG-FLOAT
  • ALEXANDRIA.0.DEV:WRITE-BYTE-VECTOR-INTO-FILE
  • ALEXANDRIA.0.DEV:STARTS-WITH-SUBSEQ
  • ALEXANDRIA.0.DEV:MULTIPLE-VALUE-COMPOSE
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-SHORT-FLOAT-P
  • ALEXANDRIA.0.DEV:NEGATIVE-SINGLE-FLOAT-P
  • ALEXANDRIA.0.DEV:SIMPLE-READER-ERROR
  • ALEXANDRIA.0.DEV:NON-POSITIVE-RATIONAL-P
  • ALEXANDRIA.0.DEV:SET-EQUAL
  • ALEXANDRIA.0.DEV:READ-FILE-INTO-STRING
  • ALEXANDRIA.0.DEV:ENDS-WITH
  • ALEXANDRIA.0.DEV:IF-LET
  • ALEXANDRIA.0.DEV:MAPHASH-KEYS
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-FIXNUM-P
  • ALEXANDRIA.0.DEV:HASH-TABLE-VALUES
  • ALEXANDRIA.0.DEV:NON-POSITIVE-DOUBLE-FLOAT
  • ALEXANDRIA.0.DEV:PLIST-HASH-TABLE
  • ALEXANDRIA.0.DEV:NON-POSITIVE-LONG-FLOAT-P
  • ALEXANDRIA.0.DEV:ENSURE-LIST
  • ALEXANDRIA.0.DEV:EMPTYP
  • ALEXANDRIA.0.DEV:ALIST-HASH-TABLE
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-INTEGER-P
  • ALEXANDRIA.0.DEV:COPY-SEQUENCE
  • ALEXANDRIA.0.DEV:ENSURE-GETHASH
  • ALEXANDRIA.0.DEV:MAP-IOTA
  • ALEXANDRIA.0.DEV:MAKE-CIRCULAR-LIST
  • ALEXANDRIA.0.DEV:NREVERSEF
  • ALEXANDRIA.0.DEV:HASH-TABLE-KEYS
  • ALEXANDRIA.0.DEV:ORDINARY-LAMBDA-LIST-KEYWORDS
  • ALEXANDRIA.0.DEV:POSITIVE-FLOAT-P
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-SINGLE-FLOAT
  • ALEXANDRIA.0.DEV:POSITIVE-SINGLE-FLOAT-P
  • ALEXANDRIA.0.DEV:ROTATE
  • ALEXANDRIA.0.DEV:SIMPLE-PARSE-ERROR
  • ALEXANDRIA.0.DEV:MAP-DERANGEMENTS
  • ALEXANDRIA.0.DEV:RANDOM-ELT
  • ALEXANDRIA.0.DEV:PARSE-ORDINARY-LAMBDA-LIST
  • ALEXANDRIA.0.DEV:NEGATIVE-INTEGER-P
  • ALEXANDRIA.0.DEV:PLIST-ALIST
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-FLOAT
  • ALEXANDRIA.0.DEV:HASH-TABLE-ALIST
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-SINGLE-FLOAT-P
  • ALEXANDRIA.0.DEV:NEGATIVE-FIXNUM
  • ALEXANDRIA.0.DEV:NEGATIVE-FLOAT-P
  • ALEXANDRIA.0.DEV:NON-POSITIVE-FIXNUM-P
  • ALEXANDRIA.0.DEV:POSITIVE-SHORT-FLOAT
  • ALEXANDRIA.0.DEV:POSITIVE-LONG-FLOAT
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-FLOAT-P
  • ALEXANDRIA.0.DEV:CIRCULAR-LIST
  • ALEXANDRIA.0.DEV:IGNORE-SOME-CONDITIONS
  • ALEXANDRIA.0.DEV:DELETE-FROM-PLISTF
  • ALEXANDRIA.0.DEV:POSITIVE-INTEGER
  • ALEXANDRIA.0.DEV:OF-TYPE
  • ALEXANDRIA.0.DEV:FORMAT-SYMBOL
  • ALEXANDRIA.0.DEV:BINOMIAL-COEFFICIENT
  • ALEXANDRIA.0.DEV:CLAMP
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-LONG-FLOAT-P
  • ALEXANDRIA.0.DEV:HASH-TABLE-PLIST
  • ALEXANDRIA.0.DEV:NEGATIVE-DOUBLE-FLOAT
  • ALEXANDRIA.0.DEV:POSITIVE-LONG-FLOAT-P
  • ALEXANDRIA.0.DEV:PROPER-LIST
  • ALEXANDRIA.0.DEV:NEGATIVE-SINGLE-FLOAT
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-LONG-FLOAT
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-DOUBLE-FLOAT
  • ALEXANDRIA.0.DEV:ENSURE-CONS
  • ALEXANDRIA.0.DEV:DISJOIN
  • ALEXANDRIA.0.DEV:WRITE-STRING-INTO-FILE
  • ALEXANDRIA.0.DEV:LENGTH=
  • ALEXANDRIA.0.DEV:NEGATIVE-LONG-FLOAT-P
  • ALEXANDRIA.0.DEV:NON-POSITIVE-REAL-P
  • ALEXANDRIA.0.DEV:WITH-INPUT-FROM-FILE
  • ALEXANDRIA.0.DEV:MAXF
  • ALEXANDRIA.0.DEV:ESWITCH
  • ALEXANDRIA.0.DEV:NEGATIVE-FLOAT
  • ALEXANDRIA.0.DEV:MAPPEND
  • ALEXANDRIA.0.DEV:POSITIVE-FIXNUM-P
  • ALEXANDRIA.0.DEV:ENSURE-FUNCTION
  • ALEXANDRIA.0.DEV:POSITIVE-FIXNUM
  • ALEXANDRIA.0.DEV:DOPLIST
  • ALEXANDRIA.0.DEV:POSITIVE-INTEGER-P
  • ALEXANDRIA.0.DEV:NTH-VALUE-OR
  • ALEXANDRIA.0.DEV:STRING-DESIGNATOR
  • ALEXANDRIA.0.DEV:WITH-UNIQUE-NAMES
  • ALEXANDRIA.0.DEV:PROPER-LIST-P
  • ALEXANDRIA.0.DEV:IOTA
  • ALEXANDRIA.0.DEV:WHICHEVER
  • ALEXANDRIA.0.DEV:ASSOC-VALUE
  • ALEXANDRIA.0.DEV:PROPER-LIST-LENGTH
  • ALEXANDRIA.0.DEV:READ-STREAM-CONTENT-INTO-BYTE-VECTOR
  • ALEXANDRIA.0.DEV:NON-POSITIVE-RATIONAL
  • ALEXANDRIA.0.DEV:NON-POSITIVE-LONG-FLOAT
  • ALEXANDRIA.0.DEV:SWITCH
  • ALEXANDRIA.0.DEV:COERCEF
  • ALEXANDRIA.0.DEV:POSITIVE-REAL
  • ALEXANDRIA.0.DEV:SIMPLE-STYLE-WARNING
  • ALEXANDRIA.0.DEV:COPY-STREAM
  • ALEXANDRIA.0.DEV:COMPOSE
  • ALEXANDRIA.0.DEV:WHEN-LET*
  • ALEXANDRIA.0.DEV:NON-POSITIVE-REAL
  • ALEXANDRIA.0.DEV:NON-POSITIVE-FLOAT-P
  • ALEXANDRIA.0.DEV:DEFINE-CONSTANT
  • ALEXANDRIA.0.DEV:NON-POSITIVE-INTEGER-P
  • ALEXANDRIA.0.DEV:MULTIPLE-VALUE-PROG2
  • ALEXANDRIA.0.DEV:POSITIVE-FLOAT
  • ALEXANDRIA.0.DEV:FIRST-ELT
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-FIXNUM
  • ALEXANDRIA.0.DEV:COPY-ARRAY
  • ALEXANDRIA.0.DEV:POSITIVE-SHORT-FLOAT-P
  • ALEXANDRIA.0.DEV:NEGATIVE-SHORT-FLOAT-P
  • ALEXANDRIA.0.DEV:NON-POSITIVE-INTEGER
  • ALEXANDRIA.0.DEV:FEATUREP
  • ALEXANDRIA.0.DEV:MAPHASH-VALUES
  • ALEXANDRIA.0.DEV:NEGATIVE-INTEGER
  • ALEXANDRIA.0.DEV:TYPE=
  • ALEXANDRIA.0.DEV:SIMPLE-PROGRAM-ERROR
  • ALEXANDRIA.0.DEV:CIRCULAR-LIST-P
  • ALEXANDRIA.0.DEV:UNWIND-PROTECT-CASE
  • ALEXANDRIA.0.DEV:ARRAY-LENGTH
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-DOUBLE-FLOAT-P
  • ALEXANDRIA.0.DEV:MEDIAN
  • ALEXANDRIA.0.DEV:CONJOIN
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-RATIONAL-P
  • ALEXANDRIA.0.DEV:SEQUENCE-OF-LENGTH-P
  • ALEXANDRIA.0.DEV:MEAN
  • ALEXANDRIA.0.DEV:REMOVEF
  • ALEXANDRIA.0.DEV:NUNIONF
  • ALEXANDRIA.0.DEV:WITH-GENSYMS
  • ALEXANDRIA.0.DEV:POSITIVE-DOUBLE-FLOAT
  • ALEXANDRIA.0.DEV:EXTREMUM
  • ALEXANDRIA.0.DEV:CSWITCH
  • SPLIT-SEQUENCE:SPLIT-SEQUENCE-IF-NOT
  • ALEXANDRIA.0.DEV:LAST-ELT
  • ALEXANDRIA.0.DEV:REQUIRED-ARGUMENT
  • ALEXANDRIA.0.DEV:NEGATIVE-RATIONAL-P
  • ALEXANDRIA.0.DEV:READ-FILE-INTO-BYTE-VECTOR
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-REAL
  • ALEXANDRIA.0.DEV:MAKE-GENSYM
  • ALEXANDRIA.0.DEV:NAMED-LAMBDA
  • ALEXANDRIA.0.DEV:MAP-COMBINATIONS
  • ALEXANDRIA.0.DEV:DELETEF
  • ALEXANDRIA.0.DEV:DELETE-FROM-PLIST
  • ALEXANDRIA.0.DEV:LERP
  • ALEXANDRIA.0.DEV:ARRAY-INDEX
  • ALEXANDRIA.0.DEV:NEGATIVE-RATIONAL
  • ALEXANDRIA.0.DEV:NEGATIVE-REAL
  • ALEXANDRIA.0.DEV:MAP-PERMUTATIONS
  • ALEXANDRIA.0.DEV:NCONCF
  • ALEXANDRIA.0.DEV:ALIST-PLIST
  • ALEXANDRIA.0.DEV:ENSURE-CAR
  • ALEXANDRIA.0.DEV:NON-POSITIVE-FLOAT
  • ALEXANDRIA.0.DEV:MAKE-KEYWORD
  • ALEXANDRIA.0.DEV:DESTRUCTURING-ECASE
  • ALEXANDRIA.0.DEV:POSITIVE-DOUBLE-FLOAT-P
  • ALEXANDRIA.0.DEV:VARIANCE
  • ALEXANDRIA.0.DEV:FACTORIAL
  • ALEXANDRIA.0.DEV:APPENDF
  • ALEXANDRIA.0.DEV:POSITIVE-RATIONAL-P
  • ALEXANDRIA.0.DEV:MAP-PRODUCT
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-INTEGER
  • ALEXANDRIA.0.DEV:COUNT-PERMUTATIONS
  • ALEXANDRIA.0.DEV:MAKE-GENSYM-LIST
  • ALEXANDRIA.0.DEV:STANDARD-DEVIATION
  • ALEXANDRIA.0.DEV:NEGATIVE-SHORT-FLOAT
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-RATIONAL
  • ALEXANDRIA.0.DEV:ENSURE-SYMBOL
  • ALEXANDRIA.0.DEV:PARSE-BODY
  • ALEXANDRIA.0.DEV:DESTRUCTURING-CCASE
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-SHORT-FLOAT
  • ALEXANDRIA.0.DEV:REMOVE-FROM-PLIST
  • ALEXANDRIA.0.DEV:REVERSEF
  • ALEXANDRIA.0.DEV:SHUFFLE
  • ALEXANDRIA.0.DEV:NON-POSITIVE-FIXNUM
  • ALEXANDRIA.0.DEV:XOR
  • ALEXANDRIA.0.DEV:NON-NEGATIVE-REAL-P
  • SPLIT-SEQUENCE:SPLIT-SEQUENCE
  • ALEXANDRIA.0.DEV:MINF
  • SPLIT-SEQUENCE:SPLIT-SEQUENCE-IF
  • ALEXANDRIA.0.DEV:RCURRY
  • ALEXANDRIA.0.DEV:NON-POSITIVE-SHORT-FLOAT-P
  • ALEXANDRIA.0.DEV:NON-POSITIVE-SINGLE-FLOAT
  • ALEXANDRIA.0.DEV:FLATTEN
  • ALEXANDRIA.0.DEV:SUBFACTORIAL
  • ALEXANDRIA.0.DEV:COPY-HASH-TABLE
  • ALEXANDRIA.0.DEV:NON-POSITIVE-SINGLE-FLOAT-P
  • ALEXANDRIA.0.DEV:ENSURE-FUNCTIONF
  • ALEXANDRIA.0.DEV:WHEN-LET
  • ALEXANDRIA.0.DEV:NEGATIVE-DOUBLE-FLOAT-P
  • ALEXANDRIA.0.DEV:NON-POSITIVE-DOUBLE-FLOAT-P
  • ALEXANDRIA.0.DEV:LASTCAR
  • ALEXANDRIA.0.DEV:READ-STREAM-CONTENT-INTO-STRING
  • ALEXANDRIA.0.DEV:RASSOC-VALUE
  • ALEXANDRIA.0.DEV:UNIONF
  • ALEXANDRIA.0.DEV:DESTRUCTURING-CASE
  • ALEXANDRIA.0.DEV:NEGATIVE-REAL-P
  • ALEXANDRIA.0.DEV:PROPER-SEQUENCE
  • ALEXANDRIA.0.DEV:GAUSSIAN-RANDOM
  • ALEXANDRIA.0.DEV:CURRY
  • ALEXANDRIA.0.DEV:NEGATIVE-FIXNUM-P
  • ALEXANDRIA.0.DEV:REMOVE-FROM-PLISTF
  • ALEXANDRIA.0.DEV:POSITIVE-REAL-P
  • ALEXANDRIA.0.DEV:ENDS-WITH-SUBSEQ
  • ALEXANDRIA.0.DEV:STARTS-WITH
  • ALEXANDRIA.0.DEV:CIRCULAR-TREE-P
  • ALEXANDRIA.0.DEV:SYMBOLICATE
  • ALEXANDRIA.0.DEV:NON-POSITIVE-SHORT-FLOAT
  • ALEXANDRIA.0.DEV:POSITIVE-RATIONAL
  • ALEXANDRIA.0.DEV:SETP
  • ALEXANDRIA.0.DEV:POSITIVE-SINGLE-FLOAT

ISO

  • Function 8601 (out arg colon-p at-sign-p &rest params)