- [Macro]
(svobject {slot | {slot value}+ })
Slot value reference. Each slot is either the
unquoted symbol or keyword name of a slot. If only one slot
is provided then sv returns that slot's value
in object. Otherwise one or more slot
and value pairs may be provided where each slot
in a pair will be set to its corresponding value. When
setting slots, the value returned by the macro (if any) depends the
underlying Lisp implementation's slot setting mechanism.
Examples:
Example 1. The sv macro.
(define m (new midi :time 0 :keynum 60)) ;;; getting slot values (sv m :keynum) ⇒ 60 (sv m time) ⇒ 0 ;;; setting slot values (sv m :duration 3) ⇒ 3 (sv m :keynum 90 :channel 10 :time 2) ⇒ 2 m ⇒ #i(midi time 2 keynum 90 duration 3 amplitude 64 channel 10)
See also:
fold-objects[Function]map-objects[Function]subobjects[Function]sv+[Macro]sv*[Macro]