CL-RemiMarshal is a library for Common Lisp that allows automatic marshalling of JSON and YAML data to and from CLOS classes.

Wanna support Remilia? Buy me a coffee on Ko-Fi, or support me through Liberapay.

Buy Me a Coffee at ko-fi.com Donate using Liberapay

How do I get set up?

Most dependencies can be installed via Quicklisp. The CL-SDM dependency cannot, however. This can be obtained from:

Once you have CL-SDM, put it (and this library) somewhere where ASDF can find them, then run this in a REPL:

(asdf:load-system :cl-remimarshal)


(asdf:load-system :cl-remimarshal)

(defclass data-config ()
    :initarg :store-data?
    :initform nil
    :yaml-type :bool
    :accessor data-config-store-data-p))
  (:metaclass cl-remimarshal-yaml:yaml-unmarshalable))

(defclass config ()
    :initarg :username
    :initform ""
    :yaml-type :string
    :accessor config-username)

    :initarg :hostname
    :initform nil
    :key-name "host"
    :yaml-type :string?
    :accessor config-hostname)
    :initform (make-instance 'data-config)
    :key-name "data"
    :yaml-type (:class data-config)))
  (:metaclass cl-remimarshal-yaml:yaml-unmarshalable))

;; Read a file into a new CONFIG instance.
(cl-remimarshal:unmarshal #P"/path/to/config.yaml" 'config)

;; Marshal a new instance to a string.
(cl-remimarshal:marshal-to-string (make-instance 'config))


Style info

I use a slightly unorthodox style for my code. Aside from these differences, please use normal Lisp formatting.

How do I contribute?

  1. Go to https://chiselapp.com/user/MistressRemilia/repository/cl-remimarshal and clone the Fossil repository.
  2. Create a new branch for your feature.
  3. Push locally to the new branch.
  4. Create a bundle with Fossil that contains your changes.
  5. Get in contact with me.


Links and Licenses

CL-RemiMarshal is under the GNU Affero General Public License version 3.