fget-value [Macro]


Purpose

The fget-value macro gets the value of a given role on a given instance. It is faster than get-value because it does no error checking or argument coercion.

Syntax

fget-value instance role

Arguments

The instance argument is the instance whose role value is to be retrieved.

The role argument is a relation, or the name of a relation. If this argument is a quoted symbol, better performance is obtained because query checks can be compiled out.

Value

If role is single-valued, fget-value returns a single filler (which may be a list). If role is multiple-valued, a list of fillers is returned.

Remarks

The fget-value function does not ensure that updates to the current state have been incorporated. If assertions are made by functions (like fget-value) that don't advance to a new state, it is necessary to manually update the database by calling new-time-point before calling fget-value.

Examples

(defrelation r :characteristics :single-valued) 
(defrelation rr) 
(set-value 'Joe 'r 'Sue) 
(set-values 'Joe 'rr '(Mary Sue (3 4 5))) 
(fget-value (fi Joe) 'r) ==> NIL 
(new-time-point) 
(fget-value (fi Joe) 'r) ==> |I|SUE 
(fget-value (fi Joe) 'rr) ==> (|I|MARY |I|SUE (3 4 5))

See Also

Last modified: Jun 1 1995