chickadee » jiffi » define-armor-printer

(define-armor-printer ...)syntax

Creates a record printer procedure using armor-printer, and sets it as the record printer for the specified record type. If you do not need to support CHICKEN 4, you may prefer to use armor-printer instead.


(define-armor-printer ARMOR-NAME
  show-address: SHOW-ADDRESS  ; optional
  (LABEL GETTER)              ; optional

All arguments have the same meaning as with armor-printer.

On CHICKEN 4, this is based on define-record-printer. On CHICKEN 5, it is based on set-record-printer!


(define-armor-printer key-event
  show-address: #f
  (#f key-event-code)
  (mods key-event-mods))

(define ev (create-key-event 'a '(lctrl)))
(printf "~A" ev)    ; #<key-event a mods: (lctrl)>

(free-key-event! ev)
(printf "~A" ev)    ; #<key-event NULL>