;;;;Addendum: ;;;;Now #'PARTHENOGENESIS returns a form rather than prints a string ;;;;And doesn't need to be called twice. Like: ;;;;> (let* ((eve (form-eve)) ;;;; (quine (parthenogenesis eve)) ;;;; (*print-pretty* t)) ;;;; (prin1 quine) ;;;; (eval quine)) ;;;; Uses #'alexandria:with-gensyms rather than just ECL ;;;; https://gitlab.common-lisp.net/alexandria/alexandria > (setq *eve* (form-eve)) # > (parthenogenesis *eve*) # > (setq *quine* (capture-read (parthenogenesis *eve*))) (let ((form '(MACROLET ((ANA-QUINE-CLASS ((&REST CLASS-PARAPHERNALIA) &BODY BODY) (EXT:WITH-GENSYMS (CLASSNAME) (SI:QUASIQUOTE (LET ((QUINE (DEFCLASS (SI:UNQUOTE CLASSNAME) (SI:UNQUOTE-SPLICE CLASS-PARAPHERNALIA)))) (SI:UNQUOTE-SPLICE BODY)))))) (ANA-QUINE-CLASS ((EVE) ((FORM :ACCESSOR FORM)) (:DOCUMENTATION " . . . ")) (VALUES (MAKE-INSTANCE QUINE)))))) (let ((particular-quine (eval form))) (setf (form particular-quine) form) (values particular-quine))) > (setq *another-eve* (eval *quine*)) # > (parthenogenesis *another-eve*) # > (setq *quine* (capture-read (parthenogenesis *another-eve*))) ... Retrospective: Something beautiful emerged out of my sleepy brain explosion filesystem quine from yesterday. I'm quite taken with what I've named eve quines. We could put the mother eve class and parthenogenesis method definition inside the 'FORM-EVE utility initial quine production, but I prefer them outside. What eve quines are is a way of producing lexical scope infinite extent CLOS (common lisp object system, sea-loss) class definition quines. You can only get to the class name using > (class-name (class-of *particular-eve*)) which I knew was a feature of CLOS, though I always had trouble using it since I think names interned by defclass are special scope. This is because the class name is a 'GENSYM. GENSYMs are only 'EQ iff they are the same GENSYM; if you type out the generated print name of a gensym, you are still refering to something else (it won't be 'EQ, which it would have to be to be the class name). Eve quines operate wholly within the lisp image, though the produced quine form could be persisted elsewhere. A few notes: x Currently nonportable ECL solely due to ECL's 'ext:with-gensyms (-> #:alexandria P) (fixed, thanks ldbeth. Also the defgeneric for (setf form)) - New eves start as subclasses of the original eve class, and would need to be MOPed (metaobject protocoled) to make their particular mother their direct-superclass. I can adjust the default behavior to this without using the MOP by adding an optional argument. - Eve quines are not yet stately, though they can easily be as desired. - Persisted eve quines will forget their mother due to her name being a gensym. - Not in an ASDF system yet (CL-USER package) I need to introduce stately eves and CLOSER-MOP to understand where this is leading.