The simple-currency Reference Manual

This is the simple-currency Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 17:53:15 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 simple-currency

SIMPLE-CURRENCY provides conversions between
currencies using data published daily by the European Central Bank, no guarantees about the accuracy of the data are given or even implied. For details of the ECB FX rates see:

http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html

Author

Peter Wood, email: pete_wood at runbox.com

License

BSD, 2 clause.

Version

0.0.1

Dependencies
  • dexador (system).
  • plump (system).
  • simple-date (system).
  • split-sequence (system).
  • cl-store (system).
Source

simple-currency.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 simple-currency/simple-currency.asd

Source

simple-currency.asd.

Parent Component

simple-currency (system).

ASDF Systems

simple-currency.


3.1.2 simple-currency/package.lisp

Source

simple-currency.asd.

Parent Component

simple-currency (system).

Packages

simple-currency.


3.1.3 simple-currency/simple-currency.lisp

Dependency

package.lisp (file).

Source

simple-currency.asd.

Parent Component

simple-currency (system).

Public Interface
Internals

3.1.4 simple-currency/currency-info.lisp

Dependency

simple-currency.lisp (file).

Source

simple-currency.asd.

Parent Component

simple-currency (system).

Public Interface
Internals

*currency-data* (special variable).


4 Packages

Packages are listed by definition order.


4.1 simple-currency

Source

package.lisp.

Nickname

cies

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *stored-currency-hash*
Package

simple-currency.

Source

simple-currency.lisp.


5.1.2 Macros

Macro: with-currency (currency conversion-form)
Package

simple-currency.

Source

simple-currency.lisp.


5.1.3 Ordinary functions

Function: 2dd-round (rat)
Package

simple-currency.

Source

simple-currency.lisp.

Function: available-currencies ()
Package

simple-currency.

Source

simple-currency.lisp.

Function: ccydb-date ()
Package

simple-currency.

Source

simple-currency.lisp.

Function: display-currency (amount &optional ccode)
Package

simple-currency.

Source

simple-currency.lisp.

Function: interval-since-update (date)
Package

simple-currency.

Source

simple-currency.lisp.

Function: update-currency-hash ()

Returns the updated hash table stored in global variable *CURRENCIES* if the update is believed to be successful, or restores the old stored hash table if the call to ECB failed and returns the old table, or NIL if both options failed for any reason.

Package

simple-currency.

Source

simple-currency.lisp.


5.1.4 Generic functions

Generic Reader: ccy-acode (object)
Package

simple-currency.

Methods
Reader Method: ccy-acode ((currency-data currency-data))

automatically generated reader method

Source

currency-info.lisp.

Target Slot

acode.

Generic Reader: ccy-country (object)
Package

simple-currency.

Methods
Reader Method: ccy-country ((currency-data currency-data))

automatically generated reader method

Source

currency-info.lisp.

Target Slot

country.

Generic Reader: ccy-ddigits (object)
Package

simple-currency.

Methods
Reader Method: ccy-ddigits ((currency-data currency-data))

automatically generated reader method

Source

currency-info.lisp.

Target Slot

ddigits.

Generic Reader: ccy-name (object)
Package

simple-currency.

Methods
Reader Method: ccy-name ((currency-data currency-data))

automatically generated reader method

Source

currency-info.lisp.

Target Slot

name.

Generic Reader: ccy-ncode (object)
Package

simple-currency.

Methods
Reader Method: ccy-ncode ((currency-data currency-data))

automatically generated reader method

Source

currency-info.lisp.

Target Slot

ncode.

Generic Function: convert (amount from to)

Converts AMOUNT between currencies FROM and TO,
which should be keywords designating 3 letter currency codes. Returns 2 values: a rational number representing the converted amount in TO currency, and a SIMPLE-DATE:INTERVAL representing the interval since the currency hash was last updated. For a list of available currency codes call (AVAILABLE-CURRENCIES).

Package

simple-currency.

Source

simple-currency.lisp.

Methods
Method: convert ((amount number) from (to (eql :eur)))
Method: convert ((amount number) (from (eql :eur)) to)
Method: convert ((amount number) from to)
Generic Function: currency-data (ccy query)
Package

simple-currency.

Source

currency-info.lisp.

Methods
Method: currency-data (ccy (query (eql :ncode)))
Method: currency-data (ccy (query (eql :name)))
Method: currency-data (ccy (query (eql :country)))
Method: currency-data (ccy (query (eql :ddigits)))
Generic Function: get-quote (amount from to)

Return 3 values: 1) The conversion as a rational,
2) the rate for converting from FROM to TO as a rational, and 3) a SIMPLE-DATE:INTERVAL representing the interval since the currency hash was last updated.

Package

simple-currency.

Source

simple-currency.lisp.

Methods
Method: get-quote ((amount number) from (to (eql :eur)))
Method: get-quote ((amount number) (from (eql :eur)) to)
Method: get-quote ((amount number) from to)
Generic Function: lookup-currency (ccy)
Package

simple-currency.

Source

currency-info.lisp.

Methods
Method: lookup-currency ((ccy symbol))
Method: lookup-currency ((ccy string))

5.1.5 Classes

Class: currency-data
Package

simple-currency.

Source

currency-info.lisp.

Direct methods
Direct slots
Slot: country
Initargs

:country

Readers

ccy-country.

Writers

This slot is read-only.

Slot: name
Type

(quote string)

Initargs

:name

Readers

ccy-name.

Writers

This slot is read-only.

Slot: acode
Type

(quote string)

Initargs

:acode

Readers

ccy-acode.

Writers

This slot is read-only.

Slot: ncode
Type

(quote string)

Initargs

:ncode

Readers

ccy-ncode.

Writers

This slot is read-only.

Slot: ddigits
Type

(quote string)

Initargs

:ddigits

Readers

ccy-ddigits.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Special variables

Special Variable: *currencies*
Package

simple-currency.

Source

simple-currency.lisp.

Special Variable: *currency-data*
Package

simple-currency.

Source

currency-info.lisp.


5.2.2 Ordinary functions

Function: getbase (curr)
Package

simple-currency.

Source

simple-currency.lisp.

Function: make-date (string)
Package

simple-currency.

Source

simple-currency.lisp.

Function: normalize-currency-designator (kw)
Package

simple-currency.

Source

simple-currency.lisp.

Function: parse-rational (string)
Package

simple-currency.

Source

simple-currency.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   2  
A   C   D   F   G   I   L   M   N   P   U   W  
Index Entry  Section

2
2dd-round: Public ordinary functions

A
available-currencies: Public ordinary functions

C
ccy-acode: Public generic functions
ccy-acode: Public generic functions
ccy-country: Public generic functions
ccy-country: Public generic functions
ccy-ddigits: Public generic functions
ccy-ddigits: Public generic functions
ccy-name: Public generic functions
ccy-name: Public generic functions
ccy-ncode: Public generic functions
ccy-ncode: Public generic functions
ccydb-date: Public ordinary functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
currency-data: Public generic functions
currency-data: Public generic functions
currency-data: Public generic functions
currency-data: Public generic functions
currency-data: Public generic functions

D
display-currency: Public ordinary functions

F
Function, 2dd-round: Public ordinary functions
Function, available-currencies: Public ordinary functions
Function, ccydb-date: Public ordinary functions
Function, display-currency: Public ordinary functions
Function, getbase: Private ordinary functions
Function, interval-since-update: Public ordinary functions
Function, make-date: Private ordinary functions
Function, normalize-currency-designator: Private ordinary functions
Function, parse-rational: Private ordinary functions
Function, update-currency-hash: Public ordinary functions

G
Generic Function, ccy-acode: Public generic functions
Generic Function, ccy-country: Public generic functions
Generic Function, ccy-ddigits: Public generic functions
Generic Function, ccy-name: Public generic functions
Generic Function, ccy-ncode: Public generic functions
Generic Function, convert: Public generic functions
Generic Function, currency-data: Public generic functions
Generic Function, get-quote: Public generic functions
Generic Function, lookup-currency: Public generic functions
get-quote: Public generic functions
get-quote: Public generic functions
get-quote: Public generic functions
get-quote: Public generic functions
getbase: Private ordinary functions

I
interval-since-update: Public ordinary functions

L
lookup-currency: Public generic functions
lookup-currency: Public generic functions
lookup-currency: Public generic functions

M
Macro, with-currency: Public macros
make-date: Private ordinary functions
Method, ccy-acode: Public generic functions
Method, ccy-country: Public generic functions
Method, ccy-ddigits: Public generic functions
Method, ccy-name: Public generic functions
Method, ccy-ncode: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, currency-data: Public generic functions
Method, currency-data: Public generic functions
Method, currency-data: Public generic functions
Method, currency-data: Public generic functions
Method, get-quote: Public generic functions
Method, get-quote: Public generic functions
Method, get-quote: Public generic functions
Method, lookup-currency: Public generic functions
Method, lookup-currency: Public generic functions

N
normalize-currency-designator: Private ordinary functions

P
parse-rational: Private ordinary functions

U
update-currency-hash: Public ordinary functions

W
with-currency: Public macros