Next: , Previous: , Up: Resources   [Contents][Index]


14.2 Basic Resource Database Functions

A resource-database structure is a CLX object that represents a set of resource bindings. The following paragraphs describe the CLX functions used to:

Function: make-resource-database
resource-database

Type resource-database.

Returns an empty resource database.

Function: add-resource database name-list value
database

The resource-database for the new resource binding.

name-list

A list containing strings or symbols specifying the name for the resource binding.

value

The value associated with the name-list in the resource binding. This can be an object of any type.

Adds the resource binding specified by name-list and value to the given database. Only one value can be associated with the name-list in the database. This function replaces any value previously associated with the name-list.

Function: delete-resource database name-list
database

The resource-database containing the resource binding.

name-list

A list containing strings or symbols specifying the name for the deleted resource binding.

Removes the resource binding specified by name-list from the given database.

Function: map-resource database function &rest args
database

A resource-database.

function

A function object or function symbol.

args

A list of arguments to the function.

Calls the function for each resource binding in the database. For each resource binding consisting of a name-list and a value, the form (apply function name-list value args) is executed.

Function: merge-resources from-database to-database
from-database

The resource-database from which resource bindings are read.

to-database

The resource-database to which resource bindings are added.

Merges the contents of the from-database with the to-database. map-resource invokes add-resource in order to add each resource binding in the from-database to the to-database. The updated to-database is returned.

to-database

Type resource-database.


Next: , Previous: , Up: Resources   [Contents][Index]