Next: , Previous: , Up: Top   [Index]


32 Object properties

An object property is a convenient interface to a weak hashtable, Weak hashtables. It is a function that can be called with one or two arguments:

Object properties are implemented by the library (vicare containers object-properties).

NOTE The idea of object properties implemented in this library comes from Guile, the GNU Ubiquitous Interface Language for Extensions.

Function: make-object-property hash-function equiv-function

Build and return a new object property. The arguments hash-function and equiv-function are handed to the weak hashtable constructor make-weak-hashtable, make-weak-hashtable.

Parameter: object-property-initial-capacity

An integer representing the suggested initial number of buckets in the hashtable. The default value is 16.

Parameter: object-property-default-value

The value to return if the property is queried for an object that was not registered before. The default value is the one bound to the sentinel ((vicare-scheme)The sentinel object).