Next Prev Up

# 13.3 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:

- Create a resource database
- Add a resource binding
- Remove a resource binding
- Merge two resource databases
- Map a function over the contents of a resource database

make-resource-database |  | Function

| Returns an empty resource database. resource-database Type resource-database.

add-resource | database name-list value | Function

| 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.

delete-resource | database name-list | Function

| 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.

map-resource | database function &rest args | Function

| 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.

merge-resources | from-database to-database | Function

| 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 Prev Up

© 1988, 1989 Texas Instruments Incorporated
Conversion to HTML made by Gilbert Baumann.
Last build: Tue Dec 16 23:30:42 1997