chickadee » cbor » cbor-codecs

cbor-codecsparameter

A list of codecs that take priority over the global registry, for use with parameterize. Built-in types are always handled first.

(define-record-type point (make-point x y) point? (x point-x) (y point-y))

(register-cbor-codec!
 (make-cbor-codec 1000001 point?
                  (lambda (p emit port) (emit (list (point-x p) (point-y p))))
                  (lambda (content) (apply make-point content))))