fget-value [Macro]


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.


fget-value instance role


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.


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.


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.


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