What is the best way to share code between client and server?
In practice mostly through macros (http://common-lisp.net/project/parenscript/reference.html#section-macros) with defmacro+ps and import-macros-from-lisp. You can also keep around pieces of code that you would COMPILE (CL) and PS-COMPILE, but I've never actually had to do that in my projects.
- Do I use the Parenscript constructs on the server? Not having CLOS
seems a shame.
You need to hide any CL-but-not-PS functionality under macros. Red Daly's Suave project (http://common-lisp.net/project/suave/) includes a CLOS for Parenscript though.
- How would one send objects between client and server?
- As JSON? How would the conversion be performed?
JSON is easiest. There's a couple of CL JSON libraries (http://common-lisp.net/project/cl-json/ and http://marijn.haverbeke.nl/st-json/). You can use Parenscript for generating JSON, but since it mostly does "the wrong thing" when you just give it data, it's easier to put something together specific to your JSON schema (which IMO should be used as an interface instead of a dumb serialization format anyway) using SYMBOL-TO-JS-STRING.
Vladimir
Thanks!
Axel
-- Axel Rauschmayer
axel@rauschma.de http://www.pst.ifi.lmu.de/people/staff/rauschmayer/axel-rauschmayer/ http://2ality.blogspot.com/ http://hypergraphs.de/
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel