[Cl-perec-devel] JSON serialization

Levente Mészáros levente.meszaros at gmail.com
Sun Sep 20 08:55:06 UTC 2009


I think being able to export persistent instances into JSON is
generally a good idea. It is already possible to export into binary
format using cl-serializer and into XML using cl-quasi-quote. These
are already implemented in cl-perec based on the mentioned libraries.

As for JSON, I think it would be best implemented as an integration
between cl-perec and cl-json. The function export-persistent-instances
could be used as an entry point. To control what is actually exported
and what is not, I don't think the suggested slot options are good
enough. It is also important to note that the way of limiting what is
exported from the database could be shared between the various export
formats (binary, xml, json). I would probably do something more
dynamic, that is store it in a context and pass that to
export-persistent-instances, maybe use layered functions, so different
export protocols can be reused with inheritance, or just use a lambda
to tell what has to be exported.

AFAICT you can't simply use slot options which are not directly
supported by the slot's class.


ps: I'm aware of your second mail

There's no perfectoin

More information about the cl-perec-devel mailing list