There are actually some pretty clever tools out there that will help you with this as well. You could take a look at CL-INTERPOL (
http://weitz.de/cl-interpol/) which, among other things, allows you to avoid having to escape quotes. It defines a reader syntax where you can use balanced delimiters like { and } to designate open and close of strings which fixes the entire issue of having to escape quotes (as long as the delimiters are balanced in the string). i.e.
- Code: Select all
CL-USER> (asdf:oos 'asdf:load-op :cl-interpol)
; loading system definition from
; /Users/smithzv/dld/src/lisp-pkg/asdf/cl-interpol.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM #:CL-INTERPOL {129ECC49}> as CL-INTERPOL
NIL
CL-USER> (cl-interpol:enable-interpol-syntax)
; No value
CL-USER> #?{"}
"\""
CL-USER> #?{"monkey{"}}
"\"monkey{\"}"
CL-USER> #?[monkey{]
"monkey{"