This is the chancery Reference Manual, version 1.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:37:57 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
chancery
A library for procedurally generating text, inspired by Tracery.
Steve Losh <steve@stevelosh.com>
MIT/X11
1.0.1
named-readtables
(system).
vendor
(module).
package.lisp
(file).
src
(module).
Modules are listed depth-first from the system components tree.
chancery/vendor
chancery
(system).
quickutils-package.lisp
(file).
quickutils.lisp
(file).
chancery/src
package.lisp
(file).
chancery
(system).
readtable.lisp
(file).
chancery.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
chancery/chancery.asd
chancery/vendor/quickutils-package.lisp
chancery/vendor/quickutils.lisp
chancery/package.lisp
chancery/src/readtable.lisp
chancery/src/chancery.lisp
chancery/vendor/quickutils-package.lisp
vendor
(module).
*utilities*
(special variable).
chancery/vendor/quickutils.lisp
quickutils-package.lisp
(file).
vendor
(module).
curry
(compiler macro).
curry
(function).
ensure-boolean
(function).
ensure-list
(function).
flip
(function).
range
(function).
rcurry
(function).
riffle
(function).
split-sequence
(function).
split-sequence-if
(function).
split-sequence-if-not
(function).
symb
(function).
ensure-function
(function).
make-gensym-list
(function).
mkstr
(function).
split-from-end
(function).
split-from-start
(function).
chancery/package.lisp
chancery/src/readtable.lisp
src
(module).
eval-reader
(function).
gen-reader
(function).
gen-string-reader
(function).
vector-reader
(function).
chancery/src/chancery.lisp
readtable.lisp
(file).
src
(module).
*random*
(special variable).
a
(function).
cap
(function).
cap-all
(function).
create-rule
(function).
create-string
(function).
define-rule
(macro).
define-string
(macro).
generate
(macro).
generate-string
(macro).
invoke-generate
(function).
invoke-generate-string
(function).
make-load-form
(method).
pos
(function).
print-object
(method).
s
(function).
%make-weightlist
(function).
-<>
(macro).
assert-nonempty
(macro).
build-weightlist-weighted
(function).
build-weightlist-zipf
(function).
cat
(function).
ch
(function).
chancery-random
(function).
chop
(function).
compile-create-rule
(function).
compile-define-rule
(function).
compile-expression
(function).
compile-list
(function).
compile-rule-body
(function).
compile-selector
(function).
compile-selector-uniform
(function).
compile-selector-weighted
(function).
compile-selector-zipf
(function).
compile-special-form
(function).
compile-string-combination
(function).
compile-string-expression
(function).
compile-string-modifiers
(function).
compile-string-other
(function).
compile-symbol
(function).
copy-weightlist
(function).
emptyp
(function).
gimme
(macro).
join-string
(function).
make-weightlist
(function).
non-keyword-symbol
(type).
prefix-sums
(function).
separate-with-spaces
(function).
special-form
(type).
special-form-p
(function).
vowelp
(function).
weightlist
(structure).
weightlist-items
(reader).
(setf weightlist-items)
(writer).
weightlist-p
(function).
weightlist-random
(function).
weightlist-sums
(reader).
(setf weightlist-sums)
(writer).
weightlist-total
(reader).
(setf weightlist-total)
(writer).
weightlist-weights
(reader).
(setf weightlist-weights)
(writer).
Packages are listed by definition order.
chancery
chancery.quickutils
.
common-lisp
.
*random*
(special variable).
a
(function).
cap
(function).
cap-all
(function).
create-rule
(function).
create-string
(function).
define-rule
(macro).
define-string
(macro).
generate
(macro).
generate-string
(macro).
invoke-generate
(function).
invoke-generate-string
(function).
pos
(function).
s
(function).
%make-weightlist
(function).
-<>
(macro).
assert-nonempty
(macro).
build-weightlist-weighted
(function).
build-weightlist-zipf
(function).
cat
(function).
ch
(function).
chancery-random
(function).
chop
(function).
compile-create-rule
(function).
compile-define-rule
(function).
compile-expression
(function).
compile-list
(function).
compile-rule-body
(function).
compile-selector
(function).
compile-selector-uniform
(function).
compile-selector-weighted
(function).
compile-selector-zipf
(function).
compile-special-form
(function).
compile-string-combination
(function).
compile-string-expression
(function).
compile-string-modifiers
(function).
compile-string-other
(function).
compile-symbol
(function).
copy-weightlist
(function).
emptyp
(function).
eval-reader
(function).
gen-reader
(function).
gen-string-reader
(function).
gimme
(macro).
join-string
(function).
make-weightlist
(function).
non-keyword-symbol
(type).
prefix-sums
(function).
separate-with-spaces
(function).
special-form
(type).
special-form-p
(function).
vector-reader
(function).
vowelp
(function).
weightlist
(structure).
weightlist-items
(reader).
(setf weightlist-items)
(writer).
weightlist-p
(function).
weightlist-random
(function).
weightlist-sums
(reader).
(setf weightlist-sums)
(writer).
weightlist-total
(reader).
(setf weightlist-total)
(writer).
weightlist-weights
(reader).
(setf weightlist-weights)
(writer).
chancery.quickutils
Package that contains Quickutil utility functions.
common-lisp
.
curry
(compiler macro).
curry
(function).
ensure-boolean
(function).
ensure-list
(function).
flip
(function).
range
(function).
rcurry
(function).
riffle
(function).
split-sequence
(function).
split-sequence-if
(function).
split-sequence-if-not
(function).
symb
(function).
*utilities*
(special variable).
ensure-function
(function).
make-gensym-list
(function).
mkstr
(function).
split-from-end
(function).
split-from-start
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
The random number generation function to use (default: ‘CL:RANDOM‘).
Define a function that will return random elements of ‘expressions‘.
‘name-and-options‘ should be of the form:
(name &key documentation (distribution :uniform) (arguments ’()))
If no options are needed a bare symbol can be given.
‘name‘ is the symbol under which the resulting function will be defined.
‘documentation‘ will be used as a docstring for the resulting function.
‘distribution‘ denotes the distribution of elements returned.
‘arguments‘ is the arglist of the resulting function.
Examples:
(define-rule color
:blue
:green
:red)
(define-rule (metal :documentation "Return a random metal."
:distribution :zipf)
:copper
:silver
:gold
:platinum)
See the full documentation for more information.
Define a function that will return random stringified elements of ‘expressions‘.
‘name-and-options‘ should be of the form:
(name &key documentation (distribution :uniform) (arguments ’()))
If no options are needed a bare symbol can be given.
‘name‘ is the symbol under which the resulting function will be defined.
‘documentation‘ will be used as a docstring for the resulting function.
‘distribution‘ denotes the distribution of elements returned.
‘arguments‘ is the arglist of the resulting function.
Examples:
(define-string color "white" "gray" "black")
(define-string (animal :distribution :weighted)
(100 (color "cat"))
(100 (color "dog"))
(100 (color "dragon")))
See the full documentation for more information.
Generate a single Chancery expression.
Example:
(define-rule x 1 2 3)
(generate (x x x))
; => (1 3 1)
Generate and stringify a single Chancery string expression.
Example:
(define-string x 1 2 3)
(generate-string (x x x))
; => "1 3 1"
Add an indefinite article (a or an) to the front of ‘string‘.
Capitalize the first character of ‘string‘.
Capitalize each word of ‘string‘.
Return a function that will return random elements of ‘expressions‘.
‘options‘ should be of the form:
(&key documentation (distribution :uniform) (arguments ’()))
‘documentation‘ will be used as a docstring for the resulting function.
‘distribution‘ denotes the distribution of elements returned.
‘arguments‘ is the arglist of the resulting function.
Examples:
(create-rule (list :blue :red :green))
(create-rule (list :copper :silver :gold :platinum)
:documentation "Return a random metal."
:distribution :zipf)
See the full documentation for more information.
Return a function that will return random stringified elements of ‘expressions‘.
‘options‘ should be of the form:
(&key documentation (distribution :uniform) (arguments ’()))
‘documentation‘ will be used as a docstring for the resulting function.
‘distribution‘ denotes the distribution of elements returned.
‘arguments‘ is the arglist of the resulting function.
Examples:
(create-string (list "white" "gray" "black"))
(create-string ’((100 (color "cat"))
(100 (color "dog"))
(100 (color "dragon")))
:distribution :weighted)
See the full documentation for more information.
Returns a function that applies ‘arguments‘ and the arguments it is called with to ‘function‘.
Convert ‘x‘ into a Boolean value.
If ‘list‘ is a list, it is returned. Otherwise returns the list designated by ‘list‘.
Return a function whose argument order of a binary function ‘f‘ is reversed.
Generate a single Chancery expression.
THIS FUNCTION IS EXPERIMENTAL AND SUBJECT TO CHANGE IN THE FUTURE.
Because this is a function, not a macro, you’ll need to do the quoting
yourself:
(define-rule x 1 2 3)
(generate (x x x))
; => (1 3 3)
(invoke-generate ’(x x x))
; => (2 1 2)
Generate and stringify a single Chancery expression.
THIS FUNCTION IS EXPERIMENTAL AND SUBJECT TO CHANGE IN THE FUTURE.
Because this is a function, not a macro, you’ll need to do the quoting
yourself:
(define-string x 1 2 3)
(generate-string (x x x))
; => "1 3 3"
(invoke-generate-string ’(x x x))
; => "2 1 2"
Make ‘string‘ posessive by adding an apostrophe (and possibly an s).
Return the list of numbers ‘n‘ such that ‘start <= n < end‘ and
‘n = start + k*step‘ for suitable integers ‘k‘. If a function ‘key‘ is
provided, then apply it to each number.
Returns a function that applies the arguments it is called with and ‘arguments‘ to ‘function‘.
Insert the item ‘obj‘ in between each element of ‘list‘.
Pluralize ‘string‘.
Return a list of subsequences in seq delimited by delimiter.
If :remove-empty-subseqs is NIL, empty subsequences will be included in the result; otherwise they will be discarded. All other keywords work analogously to those for CL:SUBSTITUTE. In particular, the behaviour of :from-end is possibly different from other versions of this function; :from-end values of NIL and T are equivalent unless :count is supplied. The second return value is an index suitable as an argument to CL:SUBSEQ into the sequence indicating where processing stopped.
Return a list of subsequences in seq delimited by items satisfying
predicate.
If :remove-empty-subseqs is NIL, empty subsequences will be included in the result; otherwise they will be discarded. All other keywords work analogously to those for CL:SUBSTITUTE-IF. In particular, the behaviour of :from-end is possibly different from other versions of this function; :from-end values of NIL and T are equivalent unless :count is supplied. The second return value is an index suitable as an argument to CL:SUBSEQ into the sequence indicating where processing stopped.
Return a list of subsequences in seq delimited by items satisfying
(CL:COMPLEMENT predicate).
If :remove-empty-subseqs is NIL, empty subsequences will be included in the result; otherwise they will be discarded. All other keywords work analogously to those for CL:SUBSTITUTE-IF-NOT. In particular, the behaviour of :from-end is possibly different from other versions of this function; :from-end values of NIL and T are equivalent unless :count is supplied. The second return value is an index suitable as an argument to CL:SUBSEQ into the sequence indicating where processing stopped.
Receives any number of objects, concatenates all into one string with ‘#’mkstr‘ and converts them to symbol.
Extracted from _On Lisp_, chapter 4.
See also: ‘symbolicate‘
weightlist
) &optional environment) ¶weightlist
) stream) ¶Thread the given forms, with ‘<>‘ as a placeholder.
Concatenate ‘strings‘ into a string.
Return the character of ‘string‘ at ‘index‘. Allows negative indices.
Chop ‘n‘ characters off the end of ‘string‘
Returns the function designated by ‘function-designator‘:
if ‘function-designator‘ is a function, it is returned, otherwise
it must be a function name and its ‘fdefinition‘ is returned.
Returns a list of ‘length‘ gensyms, each generated as if with a call to ‘make-gensym‘, using the second (optional, defaulting to ‘"G"‘) argument.
Make a weightlist of the given items and weights.
Weights can be any ‘real‘ numbers. Weights of zero are fine, as long as at least one of the weights is nonzero (otherwise there’s nothing to choose).
Receives any number of objects (string, symbol, keyword, char, number), extracts all printed representations, and concatenates them all into one string.
Extracted from _On Lisp_, chapter 4.
Return a random item from the weightlist, taking the weights into account.
sums
.
Jump to: | %
(
-
A B C D E F G I J M P R S V W |
---|
Jump to: | %
(
-
A B C D E F G I J M P R S V W |
---|
Jump to: | *
I S T W |
---|
Jump to: | *
I S T W |
---|
Jump to: | C F M N P Q R S T V W |
---|
Jump to: | C F M N P Q R S T V W |
---|