- register-serializer-extension! TAG TEST WRITER READERprocedure
Registers a handler for one additional object type, globally.
- TAG
- a symbol naming the type in the serialized stream.
- TEST
- a predicate; it returns true for objects the extension can serialize.
- WRITER
- called with two arguments, the object and the output serializer, and must emit the object's payload. The tag itself is written by the serializer before WRITER runs. Payload elements that are ordinary objects should be written with write-to-output-serializer, so that sharing is preserved.
- READER
- called with one argument, the input serializer, and must read the payload and return the reconstructed object. Payload elements should be read with read-from-input-serializer.
Later registrations take priority over earlier ones, and per-serializer extensions (the extensions: keyword of the constructors) take priority over registered ones.