This is the cambl Reference Manual, version 4.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:29:36 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cambl
A library for working with financial amounts involving multiple commodities.
Christophe Junke <junke.christophe@gmail.com>
Johh Wiegley <jwiegley@gmail.com>
BSD-3
4.0.0
cl-containers
(system).
local-time
(system).
periods
(system).
fprog
(system).
alexandria
(system).
cambl.lisp
(file).
fprog
Functional programming utilities: iteration over immutable lists sharing identical sublists.
Christophe Junke <junke.christophe@gmail.com>
Johh Wiegley <jwiegley@gmail.com>
BSD-3
1.0.0
fprog.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cambl/cambl.lisp
cambl
(system).
*default-commodity-pool*
(special variable).
*default-display-precision*
(special variable).
*extra-precision*
(special variable).
add
(generic function).
amount
(function).
amount
(structure).
amount*
(function).
amount-commodity
(reader).
(setf amount-commodity)
(writer).
amount-error
(condition).
amount-in-balance
(function).
amount-keep-precision-p
(reader).
(setf amount-keep-precision-p)
(writer).
amount-p
(function).
amount-precision
(generic function).
amount-quantity
(reader).
(setf amount-quantity)
(writer).
annotate-commodity
(generic function).
annotated-commodity
(class).
annotated-commodity-p
(function).
annotation-date
(reader).
(setf annotation-date)
(writer).
annotation-price
(reader).
(setf annotation-price)
(writer).
annotation-tag
(reader).
(setf annotation-tag)
(writer).
balance-amounts
(function).
balance-commodities
(function).
balance-commodity-count
(function).
balance-first-amount
(function).
balance-p
(function).
commodity-annotation
(generic function).
commodity-annotation
(structure).
commodity-annotation-equal
(generic function).
(setf commodity-builtin-p)
(setf expander).
commodity-builtin-p
(function).
commodity-equal
(function).
commodity-equalp
(function).
commodity-error
(condition).
(setf commodity-european-style-p)
(setf expander).
commodity-european-style-p
(function).
commodity-lessp
(function).
commodity-name
(generic function).
(setf commodity-no-market-price-p)
(setf expander).
commodity-no-market-price-p
(function).
(setf commodity-pool)
(setf expander).
commodity-pool
(function).
commodity-pool
(structure).
(setf commodity-price-history)
(setf expander).
commodity-price-history
(function).
commodity-qualified-name
(reader method).
(setf commodity-qualified-name)
(writer method).
(setf commodity-thousand-marks-p)
(setf expander).
commodity-thousand-marks-p
(function).
compare
(generic function).
compare*
(generic function).
compare-amounts-visually
(function).
display-precision
(generic function).
divide
(generic function).
exact-amount
(function).
exchange-commodity
(function).
find-annotated-commodity
(function).
find-commodity
(function).
format-value
(generic function).
get-amounts-map
(reader).
(setf get-amounts-map)
(writer).
make-commodity-annotation
(function).
make-commodity-pool
(function).
market-value
(generic function).
multiply
(generic function).
negate
(generic function).
parse-amount
(function).
parse-amount*
(function).
print-object
(method).
print-object
(method).
print-object
(method).
print-object
(method).
print-value
(generic function).
pushend
(macro).
read-amount
(function).
read-amount*
(function).
read-exact-amount
(function).
reset-commodity-pool
(function).
sign
(function).
sign*
(function).
strip-annotations
(generic function).
subtract
(generic function).
value
(type).
value-abs
(generic function).
value-equal
(generic function).
value-equalp
(generic function).
value-greatereqp
(function).
value-greatereqp*
(function).
value-greaterp
(function).
value-greaterp*
(function).
value-lesseqp
(function).
value-lesseqp*
(function).
value-lessp
(function).
value-lessp*
(function).
value-maybe-round
(function).
value-minusp
(generic function).
value-minusp*
(generic function).
value-not-equal
(generic function).
value-not-equalp
(generic function).
value-plusp
(generic function).
value-plusp*
(generic function).
value-round
(function).
value-zerop
(generic function).
value-zerop*
(generic function).
value/=
(generic function).
value<
(function).
value<=
(function).
value=
(generic function).
value>
(function).
value>=
(function).
valuep
(function).
*invalid-symbol-chars*
(special variable).
add-price
(function).
amount-full-precision
(reader).
(setf amount-full-precision)
(writer).
apply-between-amounts
(function).
apply-between-balances
(function).
apply-to-balance
(function).
balance
(function).
balance
(structure).
balance-equal
(function).
balance-helper
(function).
commodity
(class).
commodity-annotation-empty-p
(generic function).
commodity-annotation-p
(function).
(setf commodity-comment)
(setf expander).
commodity-comment
(function).
(setf commodity-description)
(setf expander).
commodity-description
(function).
commodity-pool-by-name-map
(reader).
(setf commodity-pool-by-name-map)
(writer).
commodity-pool-default-commodity
(reader).
(setf commodity-pool-default-commodity)
(writer).
commodity-pool-p
(function).
(setf commodity-symbol)
(setf expander).
commodity-symbol
(function).
commodity-symbol
(structure).
commodity-symbol-connected-p
(reader).
(setf commodity-symbol-connected-p)
(writer).
commodity-symbol-name
(reader).
(setf commodity-symbol-name)
(writer).
commodity-symbol-needs-quoting-p
(reader).
(setf commodity-symbol-needs-quoting-p)
(writer).
commodity-symbol-p
(function).
commodity-symbol-prefixed-p
(reader).
(setf commodity-symbol-prefixed-p)
(writer).
copy-amount
(function).
copy-balance
(function).
copy-commodity-annotation
(function).
copy-commodity-pool
(function).
copy-commodity-symbol
(function).
copy-pricing-entry
(function).
create-annotated-commodity
(function).
create-commodity
(function).
define-commodity-accessor
(macro).
divide-in-balance
(function).
error-commodity
(reader method).
error-description
(reader method).
error-description
(reader method).
error-operands
(reader method).
find-nearest
(function).
fixnum+
(type).
format-commodity-annotation
(function).
get-builtin-p
(reader method).
(setf get-builtin-p)
(writer method).
get-comment
(reader method).
(setf get-comment)
(writer method).
get-commodity-annotation
(reader method).
(setf get-commodity-annotation)
(writer method).
get-commodity-pool
(reader method).
(setf get-commodity-pool)
(writer method).
get-description
(reader method).
(setf get-description)
(writer method).
get-display-precision
(reader method).
(setf get-display-precision)
(writer method).
get-european-style-p
(reader method).
(setf get-european-style-p)
(writer method).
get-no-market-price-p
(reader method).
(setf get-no-market-price-p)
(writer method).
get-price-history
(reader method).
(setf get-price-history)
(writer method).
get-referent
(reader method).
(setf get-referent)
(writer method).
get-symbol
(reader method).
(setf get-symbol)
(writer method).
get-thousand-marks-p
(reader method).
(setf get-thousand-marks-p)
(writer method).
make-amount
(function).
make-balance
(function).
make-commodity-symbol
(function).
make-pricing-entry
(function).
make-qualified-name
(function).
multiply-in-balance
(function).
peek-char-in-line
(function).
pricing-entry
(structure).
pricing-entry-moment
(reader).
(setf pricing-entry-moment)
(writer).
pricing-entry-p
(function).
pricing-entry-price
(reader).
(setf pricing-entry-price)
(writer).
print-amount
(function).
print-balance
(function).
print-value-to-string
(function).
read-amount-quantity
(function).
read-commodity-annotation
(function).
read-commodity-symbol
(function).
read-until
(function).
remove-price
(function).
symbol-char-invalid-p
(function).
symbol-name-needs-quoting-p
(function).
transform-balance
(macro).
verify-amounts
(function).
fprog/fprog.lisp
fprog
(system).
apply-to-list
(macro).
insert-if
(function).
mapcar-if
(function).
remove-if
(function).
timing-tests
(function).
Packages are listed by definition order.
fprog
common-lisp
.
apply-to-list
(macro).
insert-if
(function).
mapcar-if
(function).
remove-if
(function).
timing-tests
(function).
cambl
alexandria
.
common-lisp
.
local-time
.
periods
.
*default-commodity-pool*
(special variable).
*default-display-precision*
(special variable).
*extra-precision*
(special variable).
add
(generic function).
amount
(function).
amount
(structure).
amount*
(function).
amount-commodity
(reader).
(setf amount-commodity)
(writer).
amount-error
(condition).
amount-in-balance
(function).
amount-keep-precision-p
(reader).
(setf amount-keep-precision-p)
(writer).
amount-p
(function).
amount-precision
(generic function).
amount-quantity
(reader).
(setf amount-quantity)
(writer).
annotate-commodity
(generic function).
annotated-commodity
(class).
annotated-commodity-p
(function).
annotation-date
(reader).
(setf annotation-date)
(writer).
annotation-price
(reader).
(setf annotation-price)
(writer).
annotation-tag
(reader).
(setf annotation-tag)
(writer).
balance-amounts
(function).
balance-commodities
(function).
balance-commodity-count
(function).
balance-first-amount
(function).
balance-p
(function).
commodity-annotation
(generic function).
commodity-annotation
(structure).
commodity-annotation-equal
(generic function).
(setf commodity-builtin-p)
(setf expander).
commodity-builtin-p
(function).
commodity-equal
(function).
commodity-equalp
(function).
commodity-error
(condition).
(setf commodity-european-style-p)
(setf expander).
commodity-european-style-p
(function).
commodity-lessp
(function).
commodity-name
(generic function).
(setf commodity-no-market-price-p)
(setf expander).
commodity-no-market-price-p
(function).
(setf commodity-pool)
(setf expander).
commodity-pool
(function).
commodity-pool
(structure).
(setf commodity-price-history)
(setf expander).
commodity-price-history
(function).
commodity-qualified-name
(generic reader).
(setf commodity-qualified-name)
(generic writer).
(setf commodity-thousand-marks-p)
(setf expander).
commodity-thousand-marks-p
(function).
compare
(generic function).
compare*
(generic function).
compare-amounts-visually
(function).
display-precision
(generic function).
divide
(generic function).
exact-amount
(function).
exchange-commodity
(function).
find-annotated-commodity
(function).
find-commodity
(function).
format-value
(generic function).
get-amounts-map
(reader).
(setf get-amounts-map)
(writer).
make-commodity-annotation
(function).
make-commodity-pool
(function).
market-value
(generic function).
multiply
(generic function).
negate
(generic function).
parse-amount
(function).
parse-amount*
(function).
print-value
(generic function).
pushend
(macro).
read-amount
(function).
read-amount*
(function).
read-exact-amount
(function).
reset-commodity-pool
(function).
sign
(function).
sign*
(function).
strip-annotations
(generic function).
subtract
(generic function).
value
(type).
value-abs
(generic function).
value-equal
(generic function).
value-equalp
(generic function).
value-greatereqp
(function).
value-greatereqp*
(function).
value-greaterp
(function).
value-greaterp*
(function).
value-lesseqp
(function).
value-lesseqp*
(function).
value-lessp
(function).
value-lessp*
(function).
value-maybe-round
(function).
value-minusp
(generic function).
value-minusp*
(generic function).
value-not-equal
(generic function).
value-not-equalp
(generic function).
value-plusp
(generic function).
value-plusp*
(generic function).
value-round
(function).
value-zerop
(generic function).
value-zerop*
(generic function).
value/=
(generic function).
value<
(function).
value<=
(function).
value=
(generic function).
value>
(function).
value>=
(function).
valuep
(function).
*invalid-symbol-chars*
(special variable).
add-price
(function).
amount-full-precision
(reader).
(setf amount-full-precision)
(writer).
apply-between-amounts
(function).
apply-between-balances
(function).
apply-to-balance
(function).
balance
(function).
balance
(structure).
balance-equal
(function).
balance-helper
(function).
commodity
(class).
commodity-annotation-empty-p
(generic function).
commodity-annotation-p
(function).
(setf commodity-comment)
(setf expander).
commodity-comment
(function).
(setf commodity-description)
(setf expander).
commodity-description
(function).
commodity-pool-by-name-map
(reader).
(setf commodity-pool-by-name-map)
(writer).
commodity-pool-default-commodity
(reader).
(setf commodity-pool-default-commodity)
(writer).
commodity-pool-p
(function).
(setf commodity-symbol)
(setf expander).
commodity-symbol
(function).
commodity-symbol
(structure).
commodity-symbol-connected-p
(reader).
(setf commodity-symbol-connected-p)
(writer).
commodity-symbol-name
(reader).
(setf commodity-symbol-name)
(writer).
commodity-symbol-needs-quoting-p
(reader).
(setf commodity-symbol-needs-quoting-p)
(writer).
commodity-symbol-p
(function).
commodity-symbol-prefixed-p
(reader).
(setf commodity-symbol-prefixed-p)
(writer).
copy-amount
(function).
copy-balance
(function).
copy-commodity-annotation
(function).
copy-commodity-pool
(function).
copy-commodity-symbol
(function).
copy-pricing-entry
(function).
create-annotated-commodity
(function).
create-commodity
(function).
define-commodity-accessor
(macro).
divide-in-balance
(function).
error-commodity
(generic reader).
error-description
(generic reader).
error-operands
(generic reader).
find-nearest
(function).
fixnum+
(type).
format-commodity-annotation
(function).
get-builtin-p
(generic reader).
(setf get-builtin-p)
(generic writer).
get-comment
(generic reader).
(setf get-comment)
(generic writer).
get-commodity-annotation
(generic reader).
(setf get-commodity-annotation)
(generic writer).
get-commodity-pool
(generic reader).
(setf get-commodity-pool)
(generic writer).
get-description
(generic reader).
(setf get-description)
(generic writer).
get-display-precision
(generic reader).
(setf get-display-precision)
(generic writer).
get-european-style-p
(generic reader).
(setf get-european-style-p)
(generic writer).
get-no-market-price-p
(generic reader).
(setf get-no-market-price-p)
(generic writer).
get-price-history
(generic reader).
(setf get-price-history)
(generic writer).
get-referent
(generic reader).
(setf get-referent)
(generic writer).
get-symbol
(generic reader).
(setf get-symbol)
(generic writer).
get-thousand-marks-p
(generic reader).
(setf get-thousand-marks-p)
(generic writer).
make-amount
(function).
make-balance
(function).
make-commodity-symbol
(function).
make-pricing-entry
(function).
make-qualified-name
(function).
multiply-in-balance
(function).
peek-char-in-line
(function).
pricing-entry
(structure).
pricing-entry-moment
(reader).
(setf pricing-entry-moment)
(writer).
pricing-entry-p
(function).
pricing-entry-price
(reader).
(setf pricing-entry-price)
(writer).
print-amount
(function).
print-balance
(function).
print-value-to-string
(function).
read-amount-quantity
(function).
read-commodity-annotation
(function).
read-commodity-symbol
(function).
read-until
(function).
remove-price
(function).
symbol-char-invalid-p
(function).
symbol-name-needs-quoting-p
(function).
transform-balance
(macro).
verify-amounts
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Given an input LIST, replicate as much of its structure as possible
while applying some kind of transform on its value.
For every member of the list where PREDICATE returns T, FUNCTION is called
with the list whose CAR is that member; FUNCTION should return the list which
will be substituted at that point (this makes it possible to remove, change or
insert the matched cell). If FIRST-ONLY is NIL, this is only done for every
cell that matches. Note: Be very careful when setting FIRST-ONLY to T, for if
FUNCTION returns a new list that also matches PREDICATE, an infinitely
recursive loop can occur. If SKIP-TO-NEXT is T, scanning the function
contains with the CDR of the value returned by FUNCTION, which can never lead
to infinite recursion. If LOOKAHEAD is T, the list is prescanned to see if
PREDICATE matches, otherwise copying is done regardless of whether there is a
match in LIST or not; this mimics the behavior of CL:MAPCAR and is better for
very short lists.
This function depends on the following contract with the caller:
1. The input LIST is immutable after any call to APPLY-TO-LIST until
the end of the program.
2. The returned LIST is likewise immutable.
The memory savings offered by this function comes at two costs: The first is
the subsequent immutability of the input data, and the second is an increase
in functional complexity. Specifically, while CL:MAPCAR is O(N) for a given
list, FPROG:APPLY-TO-LIST – when used to implement a sharing form of MAPCAR,
such as FPROG:MAPCAR-IF – has complexity O(N) in the best case, and O(2N) in
the worst case when LOOKAHEAD is T, otherwise it is also O(N) (where an
element to be substituted occurs at the very end of the list).
Now, the cost of speed in the worst case can lead to dramatic improvements
in memory usage in the average case, with an attendant speed advantage. Take
the case of a list which is 500 elements long. In my environment, here are
the timings for using MAPCAR to generate a new list from an old one where only
one cons cell needs to be changed. These times were determined by calling the
same code repeatedly 1,000,000 times (that code is near the end of this file,
in the function TIMING-TESTS):
Evaluation took:
8.367 seconds of real time
7.931782 seconds of user run time
0.342331 seconds of system run time
[Run times include 2.679 seconds GC run time.]
0 calls to %EVAL
0 page faults and
4,024,029,056 bytes consed.
That’s 4 gigabytes of memory, probably to be expected. The only reason this
doesn’t blow the heap is because all of the intermediate results are being
thrown away, making a lot of the cons’ing "free". If the results are kept,
the MAPCAR solution becomes impossible without dramatically increasing Lisp’s
heap size.
The memory and time costs of using MAPCAR in this example are constant no
matter whether the cons cell is substituted at the beginning, middle or end of
the 500 element list. To compare, here are the time and memory statistics
from FPROG:MAPCAR-IF for the same data, in all three cases (best, average,
worst):
Evaluation took:
3.478 seconds of real time
3.474324 seconds of user run time
0.003887 seconds of system run time
[Run times include 0.026 seconds GC run time.]
0 calls to %EVAL
0 page faults and
40,007,952 bytes consed.
In the best case, memory usage is reduced by two orders of magnitude, with an
appreciable boost in speed. If the results of this case are saved (using
COLLECT in the LOOP instead of DO), the speed savings can become dramatic.
Note also that except for the immutability constraints, the results from the
two different approaches are EQUAL.
Evaluation took:
7.495 seconds of real time
7.272269 seconds of user run time
0.173947 seconds of system run time
[Run times include 1.416 seconds GC run time.]
0 calls to %EVAL
0 page faults and
2,032,015,008 bytes consed.
In the average case (middle of the list), memory usage is cut in half, while
runtime speed is still faster. The cons’ing of CL:MAPCAR also gets more
expensive the more the results are kept, so this trivial speed tests – where
no results are saved – is not exactly fair between the two. But even still
FPROG:MAPCAR-IF is doing well.
Evaluation took:
11.343 seconds of real time
10.969349 seconds of user run time
0.327477 seconds of system run time
[Run times include 2.679 seconds GC run time.]
0 calls to %EVAL
0 page faults and
4,024,030,568 bytes consed.
Finally, the pathological case, where MAPCAR-IF degenerates into an exact
duplicate of MAPCAR. Memory use is the same, but speed is much slower because
the call to MEMBER-IF is searching the entire list before we decide that all
of it needs duplication.
Below are possible FUNCTION arguments relating to the three canonical uses
of APPLY-TO-LIST, plus the names of provided convenience functions which offer
simple implementations of them:
1. Modify an existing element: #’(lambda (list) (cons new-cons (cdr list)))
Use: (FPROG:MAPCAR-IF predicate function list)
2. Remove an existing element: #’(lambda (list) (cdr list))
Use: (FPROG:REMOVE-IF predicate list)
3. Add a new element: #’(lambda (list) (cons new-cons list))
Use: (FPROG:INSERT-IF predicate function list)
Note: When removing elements, SKIP-TO-NEXT must be set to NIL, otherwise
further matching elements might be missed. For modifying and adding elements,
SKIP-TO-NEXT is likely to always be T (the default).
The functionality offered by APPLY-TO-LIST is that every cons cell from the
original LIST, after the last matching member, is shared entirely. This is
quite different from COPY-LIST, which creates new cons cells for every
position – even those that do not require a unique structure. For example,
consider the following list:
(defparameter *alist* ’((a . 1) (b . 2) (e . 3) (f . 6) (g . 7)))
The idea is to return another version of this immutable list, while sharing
as much structure as possible – because the return value is also considered
immutable. The following function call achieves this, using the Modify
pattern from above:
(apply-to-list *alist* #’(lambda (member) (eq ’e (car member)))
#’(lambda (list) (cons (cons (caar list) 5)
(cdr list))))
=> ’((a . 1) (b . 2) (e . 5) (f . 6) (g . 7))
In the returned list, 15 atoms are shared with the original, while one new
cons cell and one new atom are created:
1, 2, 3: (a . 1)
4, 5, 6: (b . 2)
7: e
8, 9, 10 11: ((f . 6) ...)
12, 13, 14, 15: ((g . 7))
The usual practice of calling MAPCAR and changing the incorrect element
would have result in sharing only 13 atoms. That code might have looked like
this:
(mapcar #’(lambda (cell)
(if (eq ’e (car cell))
(cons (car cell) 5)
cell)) *alist*)
Further, while a discrepancy of 2 cons cells may not seem like much in this
example, the difference increases by one for every cell beyond the cell that
matches. Thus, if the input list had contained 100 cells beyond (e . 3), the
difference would have been 102 cells, and not merely 2.
Finally, in our example exactly 4 new cons cells and 1 new atom were created
as a result of the call:
1: ((a . 1) ...)
2: ((b . 2) ...)
3: ((e . 5) ...)
4: (e . 5)
5: 5
This is the minimum amount of new information required to represent a new structure where the only change is that ’e’ is paired with 5 instead of 3.
The idea of APPLY-TO-LIST is to support efficient functional programming, whereat immutable outputs are derived from immutable inputs by efficiently sharing as much structure as possible – resulting in the least new memory allocated. In cases where no references are held, this offers little gain over advanced generational garbage collection (such as lists passed within a recursive function); but where the results are held over the longer term, such as a series of computed values stored in a results list, the savings of this function can become substantial. It was exactly this kind of sitation that motivated APPLY-TO-LIST: it made it possible to reduce overall memory consumption by a factor of 20, without introducing any additional complexity into the calling code.
date
.
tag
.
Two commodities are EQUAL if they are the same object.
Return T if commodity LEFT should be sorted before RIGHT.
Find an annotated commodity matching the commodity symbol NAME,
which may be a STRING or a COMMODITY-SYMBOL, and given set of commodity
DETAILS, of type COMMODITY-ANNOTATION.
Returns two values: COMMODITY or NIL, NEWLY-CREATED-P
Find a COMMODITY identifier by the symbol name found by parsing NAME.
The NAME can be either a string or an input stream, or nil, in which case
the name is read from *STANDARD-INPUT*.
The argument :POOL specifies the commodity pool which will maintain this
commodity, and by which other code may access it again.
The argument :CREATE-IF-NOT-EXISTS-P indicates whether a new commodity
should be created if one cannot already be found.
The return values are: COMMODITY or NIL, NEWLY-CREATED-P
Parse an AMOUNT from the input stream IN.
If :OBSERVE-PROPERTIES-P is T (the default), any display details noticed in
this amount will be set as defaults for displaying this kind of commodity in
the future.
If :POOL is set, any commodities created by this routine (a maximum possible
of two, if an annotated price is given with a second commodity) will be
associated with the given commodity pool.
The possible syntax for an amount is:
[-]NUM[ ]SYM [ANNOTATION]
SYM[ ][-]NUM [ANNOTATION]
Return -1, 0 or 1 depending on the sign of AMOUNT.
Return -1, 0 or 1 depending on the sign of AMOUNT.
Round the given AMOUNT to the stated PRECISION.
If PRECISION is less than the current internal precision, data will be lost. If it is greater, this operation has no effect.
rational
) (right rational
)) ¶rational
)) ¶amount
) (details commodity-annotation
)) ¶commodity
) (details commodity-annotation
)) ¶annotated-commodity
)) ¶commodity-annotation
) (b commodity-annotation
)) ¶annotated-commodity
)) ¶rational
) (right rational
)) ¶balance
) &key omit-commodity-p full-precision-p width latter-width line-feed-string) ¶amount
) &key omit-commodity-p full-precision-p width latter-width line-feed-string) ¶rational
) &key omit-commodity-p full-precision-p width latter-width line-feed-string) ¶rational
) &optional fixed-time) ¶annotated-commodity
) &optional fixed-time) ¶rational
) (right rational
)) ¶balance
) &key output-stream omit-commodity-p full-precision-p width latter-width line-feed-string) ¶amount
) &key output-stream omit-commodity-p full-precision-p width latter-width line-feed-string) ¶rational
) &key output-stream omit-commodity-p full-precision-p width latter-width line-feed-string) ¶integer
) &key output-stream omit-commodity-p full-precision-p width latter-width line-feed-string) ¶rational
) &key keep-price keep-date keep-tag) ¶annotated-commodity
) &key keep-price keep-date keep-tag) ¶rational
) (right rational
)) ¶rational
) (right rational
)) ¶rational
) (right rational
)) ¶rational
) (right rational
)) ¶rational
) (right rational
)) ¶rational
) (right rational
)) ¶rational
) (right rational
)) ¶annotated-commodity
) stream) ¶structure-object
.
add
.
add
.
add
.
add
.
add
.
amount-precision
.
annotate-commodity
.
commodity-annotation
.
commodity-name
.
compare
.
compare
.
compare
.
compare*
.
compare*
.
compare*
.
display-precision
.
divide
.
divide
.
divide
.
divide
.
format-value
.
market-value
.
multiply
.
multiply
.
multiply
.
multiply
.
negate
.
print-object
.
print-value
.
strip-annotations
.
subtract
.
subtract
.
subtract
.
subtract
.
subtract
.
value-abs
.
value-equal
.
value-equal
.
value-equal
.
value-equal
.
value-equal
.
value-equalp
.
value-equalp
.
value-equalp
.
value-equalp
.
value-equalp
.
value-minusp
.
value-minusp*
.
value-not-equal
.
value-not-equal
.
value-not-equal
.
value-not-equal
.
value-not-equal
.
value-not-equalp
.
value-not-equalp
.
value-not-equalp
.
value-not-equalp
.
value-not-equalp
.
value-plusp
.
value-plusp*
.
value-zerop
.
value-zerop*
.
value/=
.
value/=
.
value/=
.
value/=
.
value/=
.
value=
.
value=
.
value=
.
value=
.
value=
.
(or cambl::commodity null)
rational
0
cambl::fixnum+
0
boolean
The invalid commodity symbol characters are:
Space Tab Newline Return
0-9 . , ; - + * / ^ ? : & | ! = "
< > { } [ ] ( ) @
name
.
Create an ANNOTATED-COMMODITY which annotates COMMODITY.
The NAME can be either a string or a COMMODITY-SYMBOL.
Create a COMMODITY after the symbol name found by parsing NAME.
The NAME can be either a string or an input stream, or nil, in which case
the name is read from *STANDARD-INPUT*.
The argument :pool specifies the commodity pool which will maintain this commodity, and by which other code may access it again. The resulting COMMODITY object is returned.
Return the canonical annotation string for ANNOTATION.
A fully annotated commodity always follows the form:
[-]SYMBOL <VALUE> {PRICE} [DATE] (TAG)
or
<VALUE> SYMBOL {PRICE} [DATE] (TAG)
If a particular annotation is not present, those sections is simply dropped
from the string, for example:
<VALUE> SYMBOL {PRICE}
Parse a commodity symbol from the input stream IN.
This is the correct entry point for creating a new commodity symbol.
A commodity contain any character not found in *INVALID-SYMBOL-CHARS*. To include such characters in a symbol name—except for #\", which may never appear in a symbol name—surround the commodity name with double quotes. It is an error if EOF is reached without reading the ending double quote. If the symbol name is not quoted, and an invalid character is reading, reading from the stream stops and the invalid character is put back.
Return T if the given symbol NAME requires quoting.
commodity-annotation
)) ¶commodity-error
)) ¶commodity-error
)) ¶amount-error
)) ¶amount-error
)) ¶annotated-commodity
)) ¶automatically generated reader method
annotated-commodity
)) ¶automatically generated writer method
annotated-commodity
)) ¶automatically generated reader method
annotated-commodity
)) ¶automatically generated writer method
structure-object
.
add
.
add
.
add
.
add
.
add
.
divide
.
divide
.
divide
.
format-value
.
market-value
.
multiply
.
multiply
.
multiply
.
negate
.
print-object
.
print-value
.
strip-annotations
.
subtract
.
subtract
.
subtract
.
subtract
.
subtract
.
value-abs
.
value-equal
.
value-equal
.
value-equal
.
value-equal
.
value-equal
.
value-equalp
.
value-equalp
.
value-equalp
.
value-equalp
.
value-equalp
.
value-minusp
.
value-minusp*
.
value-not-equal
.
value-not-equal
.
value-not-equal
.
value-not-equal
.
value-not-equal
.
value-not-equalp
.
value-not-equalp
.
value-not-equalp
.
value-not-equalp
.
value-not-equalp
.
value-plusp
.
value-plusp*
.
value-zerop
.
value-zerop*
.
value/=
.
value/=
.
value/=
.
value/=
.
value/=
.
value=
.
value=
.
value=
.
value=
.
value=
.
annotate-commodity
.
commodity-annotation
.
commodity-name
.
(setf commodity-qualified-name)
.
commodity-qualified-name
.
display-precision
.
(setf get-builtin-p)
.
get-builtin-p
.
(setf get-comment)
.
get-comment
.
(setf get-commodity-pool)
.
get-commodity-pool
.
(setf get-description)
.
get-description
.
(setf get-display-precision)
.
get-display-precision
.
(setf get-european-style-p)
.
get-european-style-p
.
(setf get-no-market-price-p)
.
get-no-market-price-p
.
(setf get-price-history)
.
get-price-history
.
(setf get-symbol)
.
get-symbol
.
(setf get-thousand-marks-p)
.
get-thousand-marks-p
.
market-value
.
print-object
.
strip-annotations
.
common-lisp
.
:symbol
(or string null)
:description
(or string null)
:comment
boolean
:thousand-marks-p
boolean
:european-style-p
boolean
:no-market-price-p
boolean
:builtin-p
cambl::fixnum+
0
:display-precision
:price-history
cambl:commodity-pool
:commodity-pool
(or string null)
:qualified-name
Jump to: | (
A B C D E F G I M N P R S T V |
---|
Jump to: | (
A B C D E F G I M N P R S T V |
---|
Jump to: | *
A B C D E F K M N O P Q R S T |
---|
Jump to: | *
A B C D E F K M N O P Q R S T |
---|
Jump to: | A B C F P S T V |
---|
Jump to: | A B C F P S T V |
---|