fadd-value [Function]


Purpose

The fadd-value function adds a value to a given role on a given instance. It is faster than add-value because it does no error checking or argument coercion.

Syntax

fadd-value instance role value

Arguments

The instance argument is the instance which is to receive an added role filler.

The role argument is a relation, or the name of a relation.

The value argument is a value to be added to the fillers of role. If value is a list, the list is interpreted as a single role filler. If role is single-valued, and already has a filler, the old filler is replaced by value.

Value

The fadd-value function returns value.

Examples

(defrelation rr) 
(fadd-value (fi Joe) (fr rr) (fi Mary)) ==> |I|MARY 
(fadd-value (fi Joe) (fr rr) (fi Sue)) ==> |I|SUE 
(fadd-value (fi Joe) 'rr '(3 4 5)) ==> (3 4 5) 
(get-values 'Joe 'rr) ==> (I|MARY |I|SUE (3 4 5)) 
(defrelation r :characteristics :single-valued) 
(fadd-value (fi Joe) (fr r) (fi Mary)) ==> |I|MARY 
(fadd-value (fi Joe) (fr r) (fi Sue)) ==> |I|SUE 
(get-values 'Joe 'r) ==> (|I|SUE)

See Also

Last modified: Jun 1 1995