This is the mutility Reference Manual, version 0.5, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:07:45 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
mutility
modula’s utilities
modula t.
(GIT git@github.com:defaultxr/mutility.git)
MIT
0.5
alexandria
(system).
local-time
(system).
closer-mop
(system).
sb-introspect
(system)., required, for feature :sbcl
package.lisp
(file).
mutility.lisp
(file).
ringbuffer.lisp
(file).
queue.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
mutility/mutility.asd
mutility/package.lisp
mutility/mutility.lisp
mutility/ringbuffer.lisp
mutility/queue.lisp
mutility/mutility.lisp
package.lisp
(file).
mutility
(system).
+whitespace-chars+
(constant).
a
(macro).
affixnew
(macro).
all-classes
(function).
approx=
(function).
balanced-subsequences
(function).
ceiling-by
(function).
concat
(function).
current-seconds
(compiler macro).
current-seconds
(function).
cut
(macro).
defclass+
(macro).
define-dictionary
(macro).
dprint
(macro).
elt-wrap
(function).
exponential-random-range
(function).
find-class-slot
(function).
find-if*
(function).
find-member
(function).
flatten-1
(function).
floor-by
(function).
flop
(function).
fn
(macro).
fold
(function).
friendly-bytes
(function).
friendly-bytes-string
(function).
friendly-duration-string
(function).
friendly-ratio-string
(function).
friendly-string
(function).
friendly-symbol
(function).
funcallable-object-p
(function).
function-arglist
(function).
function-designator
(type).
function-designator-p
(function).
generate-temporary-file-name
(function).
initialize-instance
(method).
insert-if
(compiler macro).
insert-if
(function).
ip-string-vector
(function).
ip-vector-string
(function).
join-path-components
(function).
join-pathnames
(compiler macro).
join-pathnames
(function).
keys
(generic function).
left-trim
(function).
length-upto
(compiler macro).
length-upto
(function).
lisp-connections
(function).
lisp-uptime
(function).
list-left-trim
(function).
list-length-upto
(compiler macro).
list-length-upto
(function).
list-length>
(compiler macro).
list-length>
(function).
list-length>=
(compiler macro).
list-length>=
(function).
mapcross
(function).
mapfold
(function).
mapshort
(function).
maptable
(function).
mapwrap
(function).
most
(function).
my-intern
(compiler macro).
my-intern
(function).
near-zero-p
(function).
no-dictionary-entry
(condition).
no-dictionary-entry-dictionary
(reader method).
no-dictionary-entry-dictionary-name
(reader method).
no-dictionary-entry-entry
(reader method).
nth-wrap
(function).
numeric-char-p
(function).
open-url
(function).
output
(function).
parse-boolean
(function).
pathname-designator
(type).
pathname-designator-p
(function).
pretty-print-tree
(function).
random-coin
(function).
random-gauss
(function).
random-range
(function).
read-as-tokens
(function).
reintern
(compiler macro).
reintern
(function).
replace-all
(compiler macro).
replace-all
(function).
restore-hash-table
(function).
rot13
(function).
round-by
(function).
round-by-direction
(compiler macro).
round-by-direction
(function).
save-hash-table
(function).
sequence-replace
(function).
sequence-split
(function).
split-sequence
(compiler macro).
split-sequence
(function).
split-string
(compiler macro).
split-string
(function).
string-designator-p
(function).
string-join*
(function).
string-replace-all*
(function).
string-split
(function).
string-split-by-string
(function).
subclasses-of
(function).
subseq*
(function).
systems-depending-on
(function).
un-intern
(compiler macro).
un-intern
(function).
upcase-intern
(function).
url-p
(function).
vowel-char-p
(function).
with-access
(macro).
wrap
(function).
*deprecated-function-error-round-by-direction-notified-p*
(special variable).
*deprecated-function-style-warning-current-seconds-notified-p*
(special variable).
*deprecated-function-style-warning-insert-if-notified-p*
(special variable).
*deprecated-function-style-warning-length-upto-notified-p*
(special variable).
*deprecated-function-style-warning-list-length>-notified-p*
(special variable).
*deprecated-function-style-warning-list-length>=-notified-p*
(special variable).
*deprecated-function-style-warning-replace-all-notified-p*
(special variable).
*deprecated-function-warning-join-pathnames-notified-p*
(special variable).
*deprecated-function-warning-list-length-upto-notified-p*
(special variable).
*deprecated-function-warning-my-intern-notified-p*
(special variable).
*deprecated-function-warning-reintern-notified-p*
(special variable).
*deprecated-function-warning-split-sequence-notified-p*
(special variable).
*deprecated-function-warning-split-string-notified-p*
(special variable).
*deprecated-function-warning-un-intern-notified-p*
(special variable).
+alphabet+
(special variable).
+quote-chars+
(constant).
expand-ranges
(function).
funcallable-wrapper
(class).
funcallable-wrapper-funcall-function
(reader method).
(setf funcallable-wrapper-funcall-function)
(writer method).
prepend-list-to-sublists
(function).
random-range.new
(function).
read-as-token
(function).
repeat
(function).
repeat-by
(function).
repeat-by-!
(function).
slot-definition-slot
(type).
split-by-!
(function).
mutility/ringbuffer.lisp
mutility.lisp
(file).
mutility
(system).
do-ringbuffer
(macro).
make-ringbuffer
(function).
print-object
(method).
ringbuffer
(structure).
ringbuffer-array
(reader).
(setf ringbuffer-array)
(writer).
ringbuffer-elt
(function).
(setf ringbuffer-elt)
(function).
ringbuffer-get
(function).
ringbuffer-index
(reader).
(setf ringbuffer-index)
(writer).
ringbuffer-initial-element
(reader).
(setf ringbuffer-initial-element)
(writer).
ringbuffer-length
(reader).
(setf ringbuffer-length)
(writer).
ringbuffer-newest
(function).
ringbuffer-oldest
(function).
ringbuffer-pop
(function).
ringbuffer-push
(function).
ringbuffer-size
(reader).
%make-ringbuffer
(function).
copy-ringbuffer
(function).
ringbuffer-p
(function).
mutility/queue.lisp
ringbuffer.lisp
(file).
mutility
(system).
do-queue
(macro).
make-queue
(function).
print-object
(method).
queue
(structure).
queue-contents
(function).
(setf queue-contents)
(function).
queue-dequeue
(function).
queue-elt
(function).
(setf queue-elt)
(function).
queue-empty
(condition).
queue-empty-p
(function).
queue-enqueue
(function).
queue-full
(condition).
queue-full-p
(function).
queue-index-out-of-range
(condition).
queue-length
(reader).
(setf queue-length)
(writer).
queue-peek
(function).
queue-size
(function).
%make-queue
(function).
copy-queue
(function).
queue-array
(reader).
(setf queue-array)
(writer).
queue-elt-internal-index
(function).
queue-empty-queue
(reader method).
queue-full-queue
(reader method).
queue-index
(reader).
(setf queue-index)
(writer).
queue-index-out-of-range-index
(reader method).
queue-index-out-of-range-queue
(reader method).
queue-p
(function).
Packages are listed by definition order.
mutility
alexandria
.
common-lisp
.
+whitespace-chars+
(constant).
a
(macro).
affixnew
(macro).
all-classes
(function).
approx=
(function).
balanced-subsequences
(function).
ceiling-by
(function).
concat
(function).
current-seconds
(compiler macro).
current-seconds
(function).
cut
(macro).
defclass+
(macro).
define-dictionary
(macro).
do-queue
(macro).
do-ringbuffer
(macro).
dprint
(macro).
elt-wrap
(function).
exponential-random-range
(function).
find-class-slot
(function).
find-if*
(function).
find-member
(function).
flatten-1
(function).
floor-by
(function).
flop
(function).
fn
(macro).
fold
(function).
friendly-bytes
(function).
friendly-bytes-string
(function).
friendly-duration-string
(function).
friendly-ratio-string
(function).
friendly-string
(function).
friendly-symbol
(function).
funcallable-object-p
(function).
function-arglist
(function).
function-designator
(type).
function-designator-p
(function).
generate-temporary-file-name
(function).
insert-if
(compiler macro).
insert-if
(function).
ip-string-vector
(function).
ip-vector-string
(function).
join-path-components
(function).
join-pathnames
(compiler macro).
join-pathnames
(function).
keys
(generic function).
left-trim
(function).
length-upto
(compiler macro).
length-upto
(function).
lisp-connections
(function).
lisp-uptime
(function).
list-left-trim
(function).
list-length-upto
(compiler macro).
list-length-upto
(function).
list-length>
(compiler macro).
list-length>
(function).
list-length>=
(compiler macro).
list-length>=
(function).
make-queue
(function).
make-ringbuffer
(function).
mapcross
(function).
mapfold
(function).
mapshort
(function).
maptable
(function).
mapwrap
(function).
most
(function).
my-intern
(compiler macro).
my-intern
(function).
near-zero-p
(function).
no-dictionary-entry
(condition).
no-dictionary-entry-dictionary
(generic reader).
no-dictionary-entry-dictionary-name
(generic reader).
no-dictionary-entry-entry
(generic reader).
nth-wrap
(function).
numeric-char-p
(function).
open-url
(function).
output
(function).
parse-boolean
(function).
pathname-designator
(type).
pathname-designator-p
(function).
pretty-print-tree
(function).
queue
(structure).
queue-contents
(function).
(setf queue-contents)
(function).
queue-dequeue
(function).
queue-elt
(function).
(setf queue-elt)
(function).
queue-empty
(condition).
queue-empty-p
(function).
queue-enqueue
(function).
queue-full
(condition).
queue-full-p
(function).
queue-index-out-of-range
(condition).
queue-length
(reader).
(setf queue-length)
(writer).
queue-peek
(function).
queue-size
(function).
random-coin
(function).
random-gauss
(function).
random-range
(function).
read-as-tokens
(function).
reintern
(compiler macro).
reintern
(function).
replace-all
(compiler macro).
replace-all
(function).
restore-hash-table
(function).
ringbuffer
(structure).
ringbuffer-array
(reader).
(setf ringbuffer-array)
(writer).
ringbuffer-elt
(function).
(setf ringbuffer-elt)
(function).
ringbuffer-get
(function).
ringbuffer-index
(reader).
(setf ringbuffer-index)
(writer).
ringbuffer-initial-element
(reader).
(setf ringbuffer-initial-element)
(writer).
ringbuffer-length
(reader).
(setf ringbuffer-length)
(writer).
ringbuffer-newest
(function).
ringbuffer-oldest
(function).
ringbuffer-pop
(function).
ringbuffer-push
(function).
ringbuffer-size
(reader).
rot13
(function).
round-by
(function).
round-by-direction
(compiler macro).
round-by-direction
(function).
save-hash-table
(function).
sequence-replace
(function).
sequence-split
(function).
split-sequence
(compiler macro).
split-sequence
(function).
split-string
(compiler macro).
split-string
(function).
string-designator-p
(function).
string-join*
(function).
string-replace-all*
(function).
string-split
(function).
string-split-by-string
(function).
subclasses-of
(function).
subseq*
(function).
systems-depending-on
(function).
un-intern
(compiler macro).
un-intern
(function).
upcase-intern
(function).
url-p
(function).
vowel-char-p
(function).
with-access
(macro).
wrap
(function).
%make-queue
(function).
%make-ringbuffer
(function).
*deprecated-function-error-round-by-direction-notified-p*
(special variable).
*deprecated-function-style-warning-current-seconds-notified-p*
(special variable).
*deprecated-function-style-warning-insert-if-notified-p*
(special variable).
*deprecated-function-style-warning-length-upto-notified-p*
(special variable).
*deprecated-function-style-warning-list-length>-notified-p*
(special variable).
*deprecated-function-style-warning-list-length>=-notified-p*
(special variable).
*deprecated-function-style-warning-replace-all-notified-p*
(special variable).
*deprecated-function-warning-join-pathnames-notified-p*
(special variable).
*deprecated-function-warning-list-length-upto-notified-p*
(special variable).
*deprecated-function-warning-my-intern-notified-p*
(special variable).
*deprecated-function-warning-reintern-notified-p*
(special variable).
*deprecated-function-warning-split-sequence-notified-p*
(special variable).
*deprecated-function-warning-split-string-notified-p*
(special variable).
*deprecated-function-warning-un-intern-notified-p*
(special variable).
+alphabet+
(special variable).
+quote-chars+
(constant).
copy-queue
(function).
copy-ringbuffer
(function).
expand-ranges
(function).
funcallable-wrapper
(class).
funcallable-wrapper-funcall-function
(generic reader).
(setf funcallable-wrapper-funcall-function)
(generic writer).
prepend-list-to-sublists
(function).
queue-array
(reader).
(setf queue-array)
(writer).
queue-elt-internal-index
(function).
queue-empty-queue
(generic reader).
queue-full-queue
(generic reader).
queue-index
(reader).
(setf queue-index)
(writer).
queue-index-out-of-range-index
(generic reader).
queue-index-out-of-range-queue
(generic reader).
queue-p
(function).
random-range.new
(function).
read-as-token
(function).
repeat
(function).
repeat-by
(function).
repeat-by-!
(function).
ringbuffer-p
(function).
slot-definition-slot
(type).
split-by-!
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
List of characters that represent whitespace like space and tab.
Quickly and conveniently generate lists. Use ! to denote repetition of the previous element, or .. to denote a range.
Inspired by similar functionality in SuperCollider.
Examples:
;; (a 3!3)
;; ;=> (3 3 3)
;; (a -5 (random 3)!5 9 10)
;; ;=> (-5 0 2 2 1 2 9 10)
;; (a 2..9)
;; ;=> (2 3 4 5 6 7 8 9)
See also: ‘fn’, ‘repeat-by-!’, ‘expand-ranges’
Affix THING to the end of PLACE if it’s not already a member.
See also: ‘alexandria:appendf’, ‘cl:pushnew’.
The cut macro; notation for specializing parameters without currying, as described in SRFI 26.
https://srfi.schemers.org/srfi-26/srfi-26.html
Examples:
;; (cut ’/ 1 <>) ;=> (lambda (x) (/ 1 x))
;; (cut <> 1 2) ;=> (lambda (func) (funcall func 1 2))
;; (cut ’+ <> <>) ;=> (lambda (x y) (+ x y))
See also: ‘fn’
‘cl:defclass’ convenience wrapper. Features a much more succinct syntax, additionally defining common functions for the class such as the predicate function.
Adds the following features to ‘cl:defclass’:
- Docstring can be specified as the first element of BODY, similar to ‘cl:defun’.
- Automatically defines a NAME-p (predicate) function.
- Adds a :function option which can be used to specify what to call when the object is ‘cl:funcall’ed. The metaclass is also automatically set to ‘closer-mop:funcallable-standard-class’.
Example:
;; (defclass+ foo ()
;; "Example class defined with defclass+"
;; (a-slot :initarg :a-slot :initform 3)
;; (:function ’print))
;;
;; (funcall (make-instance ’foo)) ; since print is the :function, this is the same as (print (make-instance ’foo))
See also: ‘cl:defclass’
Define a "dictionary" named NAME that maps symbols to objects. Defines the *NAME-dictionary* hash table and several functions for access to said table and the associated objects.
Functions defined:
- NAME-p - Test whether an object is an instance of NAME (if NAME is a class).
- find-NAME - Find the object in the dictionary with the specified name.
- (setf find-NAME) - Set the object in the dictionary with the specified name.
- all-NAMEs - Get a list of all of the objects in the dictionary.
- all-NAME-names - Get a list of all symbols defined in the dictionary.
- NAME-names - Get a list of all names in the dictionary that point to the specified object, optionally including aliases.
- If NAME is the name of a class and DEFINE-CLASS-FUNCTIONS is true, also define methods specializing on symbols for each of that class’s accessors, which look up the object pointed to by that symbol and return the value of that method being called on said object.
Options:
- NAME-TYPE - The type that a NAME dictionary name (key) can be; typically symbol, string, or string-designator.
- INCLUDE-ERRORP - Whether to include the errorp keyword argument for find-NAME.
- ERRORP-DEFAULT - The default value for find-NAME’s errorp argument.
- DEFINE-CLASS-FUNCTIONS - If t, define functions and methods for the class named NAME and error if no such class exists. If :if-class-exists, define methods if the class exists but don’t error otherwise. If nil, don’t define any methods even if the class exists.
- FIND-FUNCTION-NAME - The name that should be used to define the find-NAME function. Defaults to find-NAME.
Example:
;; (define-dictionary foo)
;;
;; (setf (find-foo ’bar) (list 1 2 3))
;;
;; (find-foo ’bar) ;=> (1 2 3)
See also: ‘make-hash-table’, ‘find-class’, ‘do-symbols’
Execute BODY once for each element in QUEUE from oldest to newest, with VAR bound to the element, then return RESULT-FORM.
See also: ‘queue-elt’, ‘queue-enqueue’, ‘queue-dequeue’, ‘queue’
Execute BODY once for each element in RINGBUFFER from oldest to newest, with VAR bound to the element, then return RESULT-FORM.
See also: ‘ringbuffer-elt’, ‘ringbuffer-push’, ‘ringbuffer-pop’, ‘ringbuffer-size’, ‘ringbuffer-index’, ‘ringbuffer-length’, ‘ringbuffer’
Easy macro to get debug output for a list of variables, ARGS. For each argument in ARGS, print the argument itself, then print what it evaluates to. Returns the last value.
Example:
;; (dprint (random 10) (+ 2 2))
...prints something like the following:
(RANDOM 10): 6; (+ 2 2): 4;
...and returns the value 4.
Syntax sugar for ‘lambda’. BODY is the function body. Symbols consisting of an underscore and a number are treated as the lambda’s argument at that index. For example, _1 is the second argument of the lambda. A single underscore is treated the same as _0.
Examples:
;; (funcall (fn (list _1 _0)) :foo :bar) ;=> (:BAR :FOO)
;; (funcall (fn (/ 3 _1)) :foo 2) ;=> 3/2
See also: ‘cut’, ‘a’
Deprecated; recommended to use metabang-bind’s "bind" macro instead.
Like ‘with-accessors’ and ‘with-slots’ combined; any slots provided as symbols are assumed to refer to both the variable name and the accessor. If no such accessor exists, just grab the slot as per ‘with-slots’.
Example:
If FOO is a function and BAR is not:
;; (with-access (foo bar) blah
;; (format t "~S ~S~%" foo bar))
...is the same as:
;; (with-accessors ((foo foo)) blah
;; (with-slots (bar) blah
;; (format t "~S ~S~%" foo bar)))
See also: ‘cl:with-accessors’, ‘cl:with-slots’
Get a list of all defined classes in the Lisp image. With PACKAGE, only get classes belonging to that package.
See also: ‘subclasses-of’
Test whether NUMBER1 and NUMBER2 are "approximately" equal, i.e. within MAX-DIST of each other.
See also: ‘near-zero-p’
Get a list of subsequences of SEQUENCE enclosed between a balanced pairs of OPEN and CLOSE.
Example:
;; (balanced-subsequences "foo [bar] baz [qux [this]] that" :open #[ :close #] :test #’char=)
;; ;=> ("bar" "qux [this]")
See also: ‘sequence-split’, ‘cl:read’
Round NUMBER up to the next multiple of BY.
See also: ‘cl:ceiling’, ‘floor-by’, ‘round-by’
Concatenate all non-nil OBJECTS together into a string.
See also: ‘cl:concatenate’, ‘uiop:strcat’
Deprecated alias for ‘lisp-uptime’.
Get the Nth item in SEQUENCE, wrapping the index if out of range. Returns the number of times "wrapped" as a second value.
Much like ‘elt’, this function can be used on any sequence. However, because this function calls ‘length’ to determine the wrapped index, it may be slow when used on large lists. Consider using ‘nth-wrap’ in those cases instead.
See also: ‘nth-wrap’
Generate a random number between LOW and HIGH, with exponential distribution.
See also: ‘random-range’, ‘random-gauss’
Find a slot in CLASS whose slot option KEY is true when TESTed against VALUE.
Like ‘find-if’, but return the index of the found item as a second value.
See also: ‘find-member’
Returns the first item from ITEMS that is a member of LIST, or nil if none are found.
See also: ‘find-if*’
Like ‘alexandria:flatten’, but only flattens one layer.
Example:
;; (flatten-1 ’(1 (2 (3 4) 5) 6))
;; ;=> (1 2 (3 4) 5 6)
See also: ‘alexandria:flatten’
Round NUMBER down to the previous multiple of BY.
See also: ‘cl:floor’, ‘ceiling-by’, ‘round-by’
Given LISTS, a list of lists, swap rows for columns.
Example:
;; (flop ’((0 1 2)
;; (2 0 1)
;; (1 2 0)))
;; ;=> ((0 2 1)
;; (1 0 2)
;; (2 1 0))
Fold numbers outside BOTTOM and TOP back into the range.
Examples:
;; (fold -1 0 1) ;=> 1
;; (fold 5 0 10) ;=> 5
;; (fold 8 0 7) ;=> 6
See also: ‘wrap’, ‘cl:mod’, ‘alexandria:clamp’
Given BYTES, a number of bytes, convert to the most "friendly" unit and return a list containing the number and the unit.
When SHORT is true, the unit is abbreviated.
See also: ‘friendly-bytes-string’
Generate a string describing BYTES as a number of bytes, kilobytes, megabytes, etc. When SHORT is true, the unit is abbreviated.
See also: ‘friendly-bytes’
Format a number of seconds as a more human-readable string. For now, hours are the biggest unit considered.
Example:
;; (friendly-duration-string 300) ;=> "5:00"
;; (friendly-duration-string 3600) ;=> "1:00:00"
See also: ‘friendly-ratio-string’
Format a ratio as a more human-readable string.
Example:
;; (friendly-ratio-string 5/4) ;=> "1 1/4"
;; (friendly-ratio-string 9/7) ;=> "1 2/7"
See also: ‘friendly-duration-string’
Return INPUT as a string with all non-letter, non-number, and non-hyphen characters removed.
Example:
;; (friendly-symbol "foo’s bar, baz, and qux") ;=> :FOOS-BAR-BAZ-AND-QUX
See also: ‘friendly-symbol’, ‘parse-boolean’, ‘friendly-ratio-string’, ‘friendly-duration-string’
Return INPUT as a symbol with all non-letter, non-number, and non-hyphen characters removed.
Example:
;; (friendly-symbol "foo’s bar, baz, and qux") ;=> :FOOS-BAR-BAZ-AND-QUX
See also: ‘friendly-string’, ‘parse-boolean’, ‘friendly-ratio-string’, ‘friendly-duration-string’
True if OBJECT is a funcallable object.
Get the signature of FUNCTION.
True if OBJECT is a ‘function-designator’, i.e. a string or pathname.
Generate a string representing a full path to a new temporary file. The file name defaults to a timestamp. Will automatically create DIRECTORY if it doesn’t exist. Will also attempt to generate a new name if a file with that name already exists.
Example:
;; (generate-temporary-file-name :name "foo" :directory "/tmp/lisp/" :extension "wav")
;; => "/tmp/lisp/foo.wav"
;; (generate-temporary-file-name :directory "/tmp/lisp/" :extension :flac)
;; => "/tmp/lisp/2020-04-20-06-09-00.flac"
See also: ‘uiop:tmpize-pathname’, ‘uiop:temporary-directory’
Destructively insert ITEM into LIST at the position where FUNCTION is true. If the function doesn’t return true, the item is inserted at the end of the list. Similar to ‘nreverse’, the input list is destructively modified.
Example:
;; (insert-if #’plusp (list -2 -1 1 2) 0) ;=> (-2 -1 0 1 2)
Convert an IP specified as a string to an IP specified as a 4-element vector.
See also: ‘ip-vector-string’
Convert an IP specified as a 4-element sequence to an IP specified as a string.
See also: ‘ip-string-vector’
Join PATH-COMPONENTS together into a single string, ensuring each is separated by exactly one directory separator.
Example:
;; (join-path-components "foo" "/bar" "baz.qux) ;=> "foo/bar/baz.qux"
See also: ‘cl:merge-pathnames’, ‘uiop:merge-pathnames*’
Deprecated alias for ‘join-path-components’.
Trim anything from BAG from the start of SEQUENCE.
See also: ‘list-left-trim’, ‘cl:string-left-trim’
Deprecated function; use ‘alexandria:length=’ instead.
Get the length of SEQUENCE, not counting above MAX.
Example:
;; (length-upto (make-list 200) 20) ;=> 20
See also: ‘alexandria:length=’
Get a list of the current connections to this Lisp image.
Get the number of seconds that Lisp has been running for.
Trim anything from BAG from the start of LIST.
See also: ‘left-trim’, ‘cl:string-left-trim’
Deprecated function; use ‘alexandria:length=’ instead.
Deprecated function; use ‘serapeum:length>’ or ‘alexandria:length=’ instead.
True if LIST is more than N in length.
See also: ‘serapeum:length>’, ‘alexandria:length=’
Deprecated function; use ‘serapeum:length>=’ or ‘alexandria:length=’ instead.
True if LIST is at least N in length. Probably more efficient than doing something like (>= (length list) n).
Example:
;; (list-length>= (make-list 300) 10) ;=> T
See also: ‘serapeum:length>=’, ‘alexandria:length=’
Make a ‘queue’ object of the specified size and the specified initial element.
See also: ‘queue-size’, ‘queue-enqueue’, ‘queue-dequeue’, ‘queue-elt’, ‘queue’
Make a ‘ringbuffer’ object of the specified size and the specified initial element.
See also: ‘ringbuffer-size’, ‘ringbuffer-index’, ‘ringbuffer-initial-element’, ‘ringbuffer-push’, ‘ringbuffer-elt’, ‘ringbuffer-pop’, ‘ringbuffer-get’, ‘ringbuffer’
"Cross" operator adverb; similar to ‘maptable’ but results in a flat list.
This function is inspired by and equivalent to SuperCollider’s ".x" operator adverb.
Example:
;; (maptable #’+ (list 10 20 30 40 50) (list 1 2 3))
;; ;=> (11 12 13 21 22 23 31 32 33 41 42 43 51 52 53)
See also: ‘mapshort’, ‘mapwrap’, ‘mapfold’, ‘maptable’
"Fold" operator adverb; apply FUNCTION to successive sets of elements from LISTS, producing a list that is the length of the longest list by "folding" indexes into the shorter lists.
This is similar to ‘mapcar’ but results in a list that is the length of the longest input list.
This function is inspired by and equivalent to SuperCollider’s ".f" operator adverb.
Example:
;; (mapfold #’+ (list 10 20 30 40 50) (list 1 2 3))
;; ;=> (11 22 33 42 51)
See also: ‘mapshort’, ‘mapwrap’, ‘maptable’, ‘mapcross’
"Short" operator adverb; apply FUNCTION to successive sets of elements from LISTS. Mostly here for completion sake, as this is effectively the same thing as regular ‘mapcar’.
This function is inspired by and equivalent to SuperCollider’s ".s" operator adverb.
Example:
;; (mapshort #’+ (list 10 20 30 40 50) (list 1 2 3))
;; => (11 22 33)
See also: ‘mapwrap’, ‘mapfold’, ‘maptable’, ‘mapcross’
"Table" operator adverb; apply FUNCTION to each element of each list in LISTS, producing a list of lists for each.
This function is inspired by and equivalent to SuperCollider’s ".t" operator adverb.
Example:
;; (maptable #’+ (list 10 20 30 40 50) (list 1 2 3))
;; ;=> ((11 12 13) (21 22 23) (31 32 33) (41 42 43) (51 52 53))
See also: ‘mapshort’, ‘mapwrap’, ‘mapfold’, ‘mapcross’
"Wrap" operator adverb; apply FUNCTION to successive sets of elements from LISTS, producing a list that is the length of the longest list by "wrapping" indexes into the shorter lists.
This is similar to ‘mapcar’ but results in a list that is the length of the longest input list.
This function is inspired by and equivalent to SuperCollider’s ".w" operator adverb.
Example:
;; (mapwrap #’+ (list 10 20 30 40 50) (list 1 2 3))
;; => (11 22 33 41 52)
See also: ‘mapshort’, ‘mapfold’, ‘maptable’, ‘mapcross’
Get the most FUNCTION item in LIST by comparing the KEY of each item with FUNCTION. Unlike ‘reduce’, this function returns the whole item from LIST, even when KEY is provided.
Example:
;; get the item in the list with the smallest car:
;; (most ’< ’((2 :bar) (3 :baz) (1 :foo)) :key ’car) ;=> (1 :FOO)
See also: ‘cl:reduce’, ‘cl:find-if’
Deprecated alias for ‘upcase-intern’.
True if NUMBER is within MAX-DIST of zero. Helps guard against division by zero.
See also: ‘approx=’
Get the Nth item in LIST, wrapping the index if out of range. Returns the number of times "wrapped" as a second value.
Much like ‘nth’, this function can only be used on lists. Use ‘elt-wrap’ to index into any kind of sequence. However, keep in mind that ‘elt-wrap’ may be slower when used on large lists.
See also: ‘elt-wrap’
True if CHAR is a character that can be part of a floating point number.
See also: ‘vowel-char-p’, ‘cl:digit-char-p’, ‘cl:alpha-char-p’, ‘cl:graphic-char-p’, ‘cl:standard-char-p’
Open a URL via the OS’s default application.
Concatenate (as per ‘concat’) and print OBJECTS, returning the last one.
See also: ‘concat’
Parse STRING as a boolean, returning either t or nil, or DEFAULT if it is not a known boolean string.
See also: ‘cl:parse-integer’, ‘url-p’
True if OBJECT is a ‘pathname-designator’, i.e. a string or pathname.
Pretty print TREE, indenting the elements of each sublist.
Get a list of the current contents of QUEUE.
Set QUEUE’s contents to CONTENTS.
Get and remove the oldest item from QUEUE. Signals ‘queue-empty’ if there are no elements in QUEUE.
See also: ‘queue-peek’, ‘queue-enqueue’, ‘queue-contents’, ‘queue’
Get the element at INDEX in QUEUE. Negative indexes are from the most recently-pushed elements, while non-negative are from the oldest. So -1 is the most recently-queued item, and -2 is the second most. 0 is the oldest item in the queue, and 1 is the second oldest.
Examples:
;; (defparameter q (make-queue 3))
;; (queue-enqueue q 0)
;; (queue-enqueue q 1)
;; (queue-enqueue q 2)
;; ;; Get the most recently-queued element:
;; (queue-elt q -1) ;=> 2
;; ;; Get the oldest element:
;; (queue-elt q 0) ;=> 0
;; ;; Get the second-oldest element:
;; (queue-elt q 1) ;=> 1
See also: ‘queue-enqueue’, ‘queue-dequeue’, ‘queue-size’, ‘queue’
True when QUEUE is empty.
See also: ‘queue-dequeue’, ‘queue-full-p’, ‘queue-enqueue’, ‘queue’
Add OBJECT to QUEUE. Signals ‘queue-full’ if QUEUE is full.
See also: ‘queue-dequeue’, ‘queue-contents’, ‘queue’
True when QUEUE is full.
See also: ‘queue-enqueue’, ‘queue-empty-p’, ‘queue-dequeue’, ‘queue’
The number of items currently in the queue.
See also: ‘queue-index’, ‘queue-size’, ‘queue’
Get the oldest item from QUEUE. Signals ‘queue-empty’ if there are no elements in QUEUE.
See also: ‘queue-dequeue’, ‘queue-enqueue’, ‘queue-contents’, ‘queue’
The maximum number of elements that QUEUE can hold.
Randomly return true with a probability of PROBABILITY/1.
Generate a random number from a normal (Gaussian) distribution.
See also: ‘random-range’, ‘exponential-random-range’, ‘alexandria:gaussian-random’
Return a random number between LOW and HIGH, inclusive. If HIGH is not provided, act the same as (random LOW).
See also: ‘exponential-random-range’, ‘random-gauss’
Read "token-like" (either separated by SEPARATORS or delimited by QUOTES) strings from STREAM, collecting them into a list of at most COUNT items. Note that QUOTES are only processed as such when they are adjacent to any of the SEPARATORS.
Deprecated function; recommend using ‘alexandria:ensure-symbol’ instead.
Deprecated alias for ‘string-replace-all*’.
Restore a hash table from a file saved with the ‘save-hash-table’ function.
Example:
;; (restore-hash-table "/home/user/blah.hash")
;; ;=> #<HASH-TABLE ...>
See also: ‘save-hash-table’
The actual array object that contains the ringbuffer data.
See also: ‘ringbuffer-size’, ‘ringbuffer-index’, ‘ringbuffer-length’, ‘ringbuffer-initial-element’
Get the element at INDEX in RINGBUFFER. Negative indexes are from the most recently-pushed elements, while zero or positive are from the oldest. So -1 is the most recently-pushed item, and -2 is the second most. 0 is the oldest item in the ringbuffer, and 1 is the second oldest.
Examples:
;; (defparameter rb (make-ringbuffer 3))
;; (ringbuffer-push rb 0)
;; (ringbuffer-push rb 1)
;; (ringbuffer-push rb 2)
;; ;; Get the most recently-pushed element:
;; (ringbuffer-elt rb -1) ;=> 2
;; ;; Get the oldest element:
;; (ringbuffer-elt rb 0) ;=> 0
;; ;; Get the second-oldest element:
;; (ringbuffer-elt rb 1) ;=> 1
See also: ‘ringbuffer-get’, ‘ringbuffer-newest’, ‘ringbuffer-oldest’, ‘ringbuffer-push’, ‘ringbuffer-size’, ‘ringbuffer-index’, ‘ringbuffer-initial-element’, ‘ringbuffer’
Get the oldest element from RINGBUFFER, removing it in the process.
See also: ‘ringbuffer-pop’, ‘ringbuffer-elt’, ‘ringbuffer-push’, ‘ringbuffer-size’, ‘ringbuffer-index’, ‘ringbuffer-initial-element’, ‘ringbuffer’
The current index into the ringbuffer that new elements will be pushed to.
See also: ‘ringbuffer-length’, ‘ringbuffer-size’, ‘ringbuffer-initial-element’
The initial element that each cell in the ringbuffer defaults to, and is set to when the cell is ‘ringbuffer-pop’ped or ‘ringbuffer-get’ted.
See also: ‘ringbuffer-size’, ‘ringbuffer-index’, ‘ringbuffer-length’
The length of the ringbuffer, i.e. the number of items currently in it. It is always a number in the range from 0 to ‘ringbuffer-size’.
See also: ‘ringbuffer-index’, ‘ringbuffer-size’, ‘ringbuffer-initial-element’
Get a list of the last N items in RINGBUFFER, from most to least recent.
See also: ‘ringbuffer-oldest’, ‘ringbuffer-elt’, ‘do-ringbuffer’, ‘ringbuffer’
Get a list of the oldest N items in RINGBUFFER, from least to most recent.
See also: ‘ringbuffer-newest’, ‘ringbuffer-elt’, ‘do-ringbuffer’, ‘ringbuffer’
Get the element most recently pushed to RINGBUFFER, removing it and decreasing the ‘ringbuffer-index’ to point at the next most recent element.
See also: ‘ringbuffer-get’, ‘ringbuffer-elt’, ‘ringbuffer-push’, ‘ringbuffer-size’, ‘ringbuffer-index’, ‘ringbuffer-initial-element’, ‘ringbuffer’
Add OBJECT to RINGBUFFER.
See also: ‘ringbuffer-pop’, ‘ringbuffer-get’, ‘ringbuffer-elt’, ‘ringbuffer-size’, ‘ringbuffer-index’, ‘ringbuffer-initial-element’, ‘ringbuffer’
The maximum size of the ringbuffer.
See also: ‘ringbuffer-length’, ‘ringbuffer-index’, ‘ringbuffer-initial-element’
size
.
Rotate the characters of STRING alphabetically by N letters.
Round NUMBER to the nearest multiple of BY.
Examples:
;; (round-by 1 2) ; => 0
;; (round-by 1.1 0.5) ; => 1.0
;; (round-by 6 10) ; => 10
See also: ‘cl:round’, ‘floor-by’, ‘ceiling-by’
Deprecated; use either ‘floor-by’, ‘ceiling-by’, or ‘round-by’ instead.
Save a hash table to a file. See ‘restore-hash-table’ to load the saved table.
Example:
;; (save-hash-table *my-hash* "/home/user/blah.hash" :if-exists :rename)
See also: ‘restore-hash-table’
Replace instances of TARGET with REPLACEMENT in SEQUENCE, optionally limiting to COUNT replacements. Returns the number of replacements made as a second value.
See also: ‘sequence-split’
Split SEQUENCE by searching for instances of DELIMITER using TEST. After finding a match for DELIMITER, the next search is run on the subsequence of SEQUENCE OFFSET from the location of the match.
Example:
;; (sequence-split "foo - bar - baz" " - " :test ’search)
;; ;=> ("foo" "bar" "baz")
See also: ‘sequence-replace’, ‘balanced-subsequences’
Deprecated alias for ‘sequence-split’.
Deprecated alias for ‘string-split’.
True if OBJECT is a string-designator, i.e. a string or symbol.
See also: ‘alexandria:string-designator’
Join all non-nil elements of STRINGS together, separated by SEPARATOR.
Similar to ‘serapeum:string-join’, but ignores nils in STRINGS.
Examples:
;; (string-join* (list "foo" "bar" "baz") "-") ;=> "foo-bar-baz"
;; (string-join* (list "foo" nil "baz") "-") ;=> "foo-baz"
See also: ‘concat’, ‘serapeum:string-join’
Get a new string in which all the occurences of the part is replaced with replacement.
See also: ‘cl-ppcre:regex-replace-all’
Split STRING into a list of substrings by partitioning by the characters in CHAR-BAG, optionally to a list of maximum size COUNT. If INCLUDE-EMPTY is true, include empty strings in the resulting list (and length count); otherwise exclude them.
Example:
;; (string-split "this that the other thing")
;; ;=> ("this" "that" "the" "other" "thing")
;; (string-split " foo bar baz qux " :count 2)
;; ;=> ("foo" "bar baz qux ")
See also: ‘string-split-by-string’, ‘sequence-split’, ‘str:split’, ‘split-sequence:split-sequence’
Split STRING into a list of substrings by partitioning by the string SPLIT-BY, optionally to a list of maximum size COUNT. If INCLUDE-EMPTY is true, include empty strings in the resulting list (and length count); otherwise exclude them. CHAR-COMPARISON is the function to use to compare characters; typically this is either ‘char=’ (the default) for case-sensitive comparison or ‘char-equal’ for case-insensitive comparison.
Example:
;; (string-split-by-string "this - that - the-other thing" " - ")
;; ;=> ("this" "that" "the-other thing")
See also: ‘string-split’, ‘sequence-split’, ‘str:split’, ‘split-sequence:split-sequence’
Get a list of all direct subclasses of CLASS. If RECURSIVE-P is true, recursively get all subclasses.
See also: ‘all-classes’
Like subseq, but allows start and end to be negative.
Get a list of systems in the current image that include SYSTEM in their :depends-on.
Deprecated alias for ‘string-downcase’.
Uppercase and convert STRING into a symbol.
See also: ‘alexandria:ensure-symbol’, ‘string-downcase’
True if STRING looks like a valid URL. If CASE-SENSITIVE, the protocol must be lowercase for the URL to be valid.
See also: ‘open-url’, ‘pathname-designator-p’, ‘parse-boolean’
True if CHAR is a vowel character (i.e. a, e, i, o, or u, and sometimes y and/or w).
See also: ‘numeric-char-p’, ‘cl:alpha-char-p’, ‘cl:digit-char-p’, ‘cl:graphic-char-p’, ‘cl:standard-char-p’
Wraps a number between BOTTOM and TOP, similar to ‘cl:mod’.
Examples:
;; (wrap 2 0 1) ; => 0
;; (wrap 5 0 10) ; => 5
;; (wrap 15 0 10) ; => 4
See also: ‘fold’, ‘cl:mod’, ‘alexandria:clamp’
Get the keys of OBJECT, whether it be a plist, hash table, etc.
The dictionary object itself.
no-dictionary-entry
)) ¶The name of the dictionary.
no-dictionary-entry
)) ¶The name of the entry being looked up.
no-dictionary-entry
)) ¶funcallable-wrapper
) &key) ¶ringbuffer
) stream) ¶Condition for when a dictionary entry is not found.
error
.
The name of the entry being looked up.
:entry
This slot is read-only.
The name of the dictionary.
:dictionary-name
This slot is read-only.
The dictionary object itself.
:dictionary
This slot is read-only.
Condition for when a ‘queue’ is empty.
condition
.
:queue
This slot is read-only.
Condition for when a ‘queue’ is full.
condition
.
:queue
This slot is read-only.
Condition for when the requested index of a ‘queue’ is out of range.
A first-in-first-out queue.
See also: ‘ringbuffer’
A ringbuffer, also known as a circular buffer. Items can be pushed onto it and popped from it just like a regular stack, except that has a finite size. After SIZE elements are pushed to it, the next push overwrites the least recent element.
structure-object
.
integer
10
This slot is read-only.
integer
0
common-lisp
.
integer
0
common-lisp
.
List of characters that represent quotation marks like QUOTATION_MARK and APOSTROPHE.
Expand ranges denoted by a..b in list.
Example:
;; (expand-ranges ’(0..5 -2..2)) ;; => (0 1 2 3 4 5 -2 -1 0 1 2)
Prepend the symbol ’list to LIST and all of its sublists.
Get the index into QUEUE’s internal array to access INDEX.
See also: ‘queue-elt’
The index into the queue’s internal array of the element that would be dequeued by ‘queue-dequeue’.
See also: ‘queue-length’, ‘queue-size’, ‘queue-dequeue’, ‘queue’
Return a random number between LOW and HIGH, inclusive. If HIGH is not provided, act the same as (random LOW).
Read a "token-like" (either separated by SEPARATORS or delimited by QUOTES) string from STREAM. Note that only the start and end of potential tokens (i.e. adjacent to any of SEPARATORS) are checked for QUOTES.
See also: ‘read-as-tokens’
Get a list containing REPEATS ITEMs. If ITEM is a function, return a list of REPEATS of the result of that function.
Example:
;; (repeat (lambda () (random 10)) 10)
;; ;=> (7 0 6 6 7 9 8 1 9 8)
Returns a list of object repeated REPEATS times. If REPEATS is a list of multiple numbers, recursively repeat the generated lists.
When ADD-LIST is true, prepend ’list to each generated list.
Example:
;; (repeat-by 3 3)
;; => (3 3 3)
;;
;; (repeat-by 3 ’(3 2))
;; => ((3 3 3) (3 3 3))
See also: ‘repeat-by-!’, ‘a’
Given LIST, repeat items marked with ! by the number after the !.
When ADD-LIST is true, prepend ’list to each generated list. This is useful if you’re using this function in a macro, such as the ‘a’ macro, which this function does all the heavy lifting for.
Examples:
;; (repeat-by-! ’(1!2))
;; => (1 1)
;;
;; (repeat-by-! ’(1!2!3))
;; => ((1 1) (1 1) (1 1))
;;
;; (repeat-by-! ’(1 (* 2 3)!2))
;; => (1 (* 2 3) (* 2 3))
See also: ‘repeat-by’, ‘a’
Split STRING up by exclamation points.
funcallable-wrapper
)) ¶funcallable-wrapper
)) ¶The function to call when this object is ‘funcall’ed.
queue-empty
)) ¶queue-full
)) ¶queue-index-out-of-range
)) ¶queue-index-out-of-range
)) ¶Simple wrapper class to apply funcallable object functionality to funcallable objects defined with ‘defclass+’.
funcallable-standard-object
.
The function to call when this object is ‘funcall’ed.
function
mutility::funcall-function
Slots of slot definitions. This is primarily used for ‘find-class-slot’.
See also: ‘find-class-slot’
Jump to: | %
(
A B C D E F G I J K L M N O P Q R S U V W |
---|
Jump to: | %
(
A B C D E F G I J K L M N O P Q R S U V W |
---|
Jump to: | *
+
A C D E F I L Q S |
---|
Jump to: | *
+
A C D E F I L Q S |
---|
Jump to: | C F M N P Q R S T |
---|
Jump to: | C F M N P Q R S T |
---|