<commit_before>(defpackage :versioned-objects
  (:use :common-lisp
	:closer-mop)
  (:export :versioned-object
	   :snapshot
	   :rm-snapshot
	   :restore
	   :changed-p
	   :snapshot-p
	   :snapshot-value))

(in-package :versioned-objects)

(defconstant +unbound-slot+ '+unbound-slot+)
(defparameter *auto-snap-init* :init "Set this to nil to stop the storage of the initial state in :init")

(defgeneric snapshot (object name)
  (:documentation "Takes a snapshot of the given class"))
(defgeneric restore (object version)
  (:documentation "Restores the object to the given version"))
(defgeneric changed-p (object version &rest options &key test)
  (:documentation "Indicates the class has changed with respect to the variables that have been set in the given version"))
(defgeneric snapshot-p (object version)
  (:documentation "Indicates whether or not <object> has a snapshot named <version>"))
(defgeneric snapshot-value (object version slot)
  (:documentation "Returns the value <object> had for slot <slot> in snapshot <snaphot>"))
(defgeneric rm-snapshot (object snapshot)
  (:documentation "Removes the snapshot <snapshot> from object <object>"))

(defclass versioned-object ()
  ((versioned-vals :initform nil)<commit_msg>Updating for the new closer-mop<commit_after>(defpackage :versioned-objects
  (:use :common-lisp
	:closer-mop)
  (:shadowing-import-from :closer-mop :defmethod :standard-generic-function :defmethod :defgeneric :standard-generic-function)
  (:export :versioned-object
	   :snapshot
	   :rm-snapshot
	   :restore
	   :changed-p
	   :snapshot-p
	   :snapshot-value))

(in-package :versioned-objects)

(defconstant +unbound-slot+ '+unbound-slot+)
(defparameter *auto-snap-init* :init "Set this to nil to stop the storage of the initial state in :init")

(defgeneric snapshot (object name)
  (:documentation "Takes a snapshot of the given class"))
(defgeneric restore (object version)
  (:documentation "Restores the object to the given version"))
(defgeneric changed-p (object version &rest options &key test)
  (:documentation "Indicates the class has changed with respect to the variables that have been set in the given version"))
(defgeneric snapshot-p (object version)
  (:documentation "Indicates whether or not <object> has a snapshot named <version>"))
(defgeneric snapshot-value (object version slot)
  (:documentation "Returns the value <object> had for slot <slot> in snapshot <snaphot>"))
(defgeneric rm-snapshot (object snapshot)
  (:documentation "Removes the snapshot <snapshot> from object <object>"))

(defclass versioned-object ()
  ((versioned-vals :initform nil)
{'fraction_non_alphanumeric': 0.11068556108770586, 'fraction_numerical': 0.0, 'mean_word_length': 5.131455399061033, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1168147', 'n_tokens_mistral': 777, 'n_tokens_neox': 742, 'n_words': 280}