object-addressGBBopen Toolsprint-instance-slotsprint-instance-slot-valueGoTo Top

print-instance-slot-value   instance slot-name stream &key function no-space[Generic Function]

Purpose
Print the value of the slot-name slot in instance or [Unbound], if the slot is unbound.

Method signatures

print-instance-slot-value  (instance standard-gbbopen-instance) slot-name stream

Package   :gbbopen-tools

Module   :gbbopen-tools

Arguments and values

instance     A standard-gbbopen-instance object
slot-name     A non-nil, non-keyword symbol
stream     A stream
function     A function designator specifying a function object of one argument
no-space     A generalized boolean (default is nil)

Description
Unless no-space is true, a space character is printed to stream. Then the slot value in instance specified by slot-name is printed to stream, unless the slot is unbound, in which case [Unbound] is printed to stream.

If the slot is bound and function is specifed, function is called with the slot value and the result is printed to stream rather than the slot value.

See also
    print-instance-slots
    standard-gbbopen-instance

Example
Extend the print-object printing for hyp instances to include location and belief slot values:

  (defmethod print-instance-slots ((obj hyp) stream)
    (call-next-method)
    (print-instance-slot-value obj 'location stream)
    (print-instance-slot-value obj 'belief stream))


The GBBopen Project


object-addressGBBopen Toolsprint-instance-slotsprint-instance-slot-valueGoTo Top