metacopy

API Reference

metacopy

Flexible Common Lisp shallow/deep copy mechanism.

METACOPY

  • Macro DEFINE-COPY-METHOD (name args &rest options)
    A defmethod, without contextl.
  • Generic-Function COPY-THING (thing)
    Copy objects with aribtrarily complex substructure. Objects are kept track of in a HashTable, so only one copy is made of each. Things which are EQ in the original (i.e. objects, sublists, etc.) come out EQ in the corresponding places in the copy.
  • Generic-Function COPY-ONE (self copy-htable)
    returns a fullfledged copy of self, set-up and ready to go.
  • Generic-Function COPY-SELF (self)
    return a new, empty version of self
  • Generic-Function COPY-INNER (self copy-object copy-htable)
    copy the relevant portions of self into copy-object. ok if it calls copy on sub-objects.
  • Generic-Function COPY-INNER-CLASS (self copy-object copy-htable)
    Defined for each component class of an object with mixin COPYABLE-MIXIN. It should setup its slots as appropriate. This needs to be a seperate method (from COPY-INNER) because it has to be done with a PROGN Method-Combination.
  • Generic-Function COPY-SLOTS-SLOTS-TO-INITIALIZE (self)
  • Method COPY-SLOTS-SLOTS-TO-INITIALIZE ((self standard-object))
  • Method COPY-SLOTS-SLOTS-TO-INITIALIZE ((self standard-object))
  • Method COPY-SLOTS-SLOTS-TO-INITIALIZE ((self standard-object))
  • Variable *COPY-ASSUME-NO-CIRCULAR-LISTS*
    nil
  • Method COPY-THING (original-thing)
  • Method COPY-ONE (original-thing copy-htable)
  • Method COPY-ONE (original-thing (copy-htable (eql nil)))
  • Method COPY-SELF (self)
  • Method COPY-INNER (self copy-object copy-htable)
    default is to do nothing.
  • Method COPY-SELF ((original string))
  • Method COPY-INNER ((original string) new-array copy-htable)
  • Method COPY-SELF ((original array))
  • Method COPY-INNER ((original array) new-array copy-htable)
  • Method COPY-SELF ((original hash-table))
  • Method COPY-INNER ((original-table hash-table) new-table copy-htable)
  • Method COPY-SELF ((original-list list))
  • Method COPY-INNER ((original-list list) copy-list copy-htable)
  • Class COPYABLE-MIXIN
    provides method for doing copy that creates a copy on an object. each mixin should provide an copy-inner-class method to copy its slots appropriately.
    No slots.
  • Method COPY-SELF ((self copyable-mixin))
  • Method INSTANCE-MADE-FOR-COPYING-P ((object t))
  • Method COPY-INNER-CLASS ((original-object copyable-mixin) copy-list copy-htable)
  • Method COPY-INNER ((original-object standard-object) copy-list copy-htable)
  • Macro WITH-SLOT-COPYING ((copy-object copy-htable &optional (original-object 'self)) &body body)
  • Macro DUPLICATOR-METHODS ((class-name &key (symbol 'self) (copy-forms? *duplicate-class-forms-copy-forms?*)) all-slots slot-forms &optional final-duplicate-forms)
  • Macro DEFCOPY-METHODS (class &key copy set copy-all set-all)
    Put a different face on duplicator-methods's syntax.

Also exports

  • METABANG.MOPTILITIES:COPY-TEMPLATE

metacopy-with-contextl

METACOPY-WITH-CONTEXTL

  • Macro DEFINE-COPY-PROTOCOL (name &optional super-protocols &rest options)
    Define a copy protocol, which directly maps to a ContextL layer.
  • Macro DEFINE-COPY-METHOD (name &rest body)
    Ends up as a define-layered-method with special support for copy-specific syntax features.
  • Function COPY-THING (thing)
  • Function COPY-ONE (self copy-htable)
  • Function COPY-SELF (self)
  • Function COPY-INNER (self copy-object copy-htable)
  • Function COPY-INNER-CLASS (self copy-object copy-htable)
  • Function COPY-SLOTS-SLOTS-TO-INITIALIZE (self)
  • Variable *COPY-ASSUME-NO-CIRCULAR-LISTS*
    nil
  • Class COPYABLE-MIXIN
    provides method for doing copy that creates a copy on an object. each mixin should provide an copy-inner-class method to copy its slots appropriately.
    No slots.
  • Method INSTANCE-MADE-FOR-COPYING-P ((object t))
  • Macro WITH-SLOT-COPYING ((copy-object copy-htable &optional (original-object 'self)) &body body)
  • Macro DUPLICATOR-METHODS ((class-name &key (symbol 'self) (copy-forms? *duplicate-class-forms-copy-forms?*)) all-slots slot-forms &optional final-duplicate-forms)
  • Macro DEFCOPY-METHODS (class &key copy set copy-all set-all)
    Put a different face on duplicator-methods's syntax.

Also exports

  • METABANG.MOPTILITIES:COPY-TEMPLATE