<commit_before>(cl:in-package #:sicl-boot-phase2)

(defun ld (filename environment)
  (format *trace-output* "Loading file ~a~%" filename)
  (finish-output *trace-output*)
  (sicl-extrinsic-environment:load-source-with-environments
   (asdf:system-relative-pathname :sicl-boot-phase2 filename)
   (compilation-environment environment)
   environment))

(defun define-ensure-generic-function (environment)
  (setf (sicl-genv:fdefinition 'ensure-generic-function environment)
	(lambda (function-name &rest arguments)
	  (if (sicl-genv:fboundp function-name environment)
	      (sicl-genv:fdefinition function-name environment)
	      (let ((new-arguments (copy-list arguments)))
		(loop while (remf new-arguments :environment))
		(setf (sicl-genv:fdefinition function-name environment)
		      (apply #'make-instance
			     (sicl-genv:find-class
			      'standard-generic-function
			      (phase1-environment environment))
			     new-arguments)))))))

(defun fill-environment (environment)
  (define-ensure-generic-function environment)
  (sicl-genv:fmakunbound 'sicl-clos:method-function environment)
  (ld "../../CLOS/method-function-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:method-generic-function environment)
  (ld "../../CLOS/method-generic-function-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:method-lambda-list environment)
  (ld "../../CLOS/method-lambda-list-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:method-qualifiers environment)
  (ld "../../CLOS/method-qualifiers-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:method-specializers environment)
  (ld "../../CLOS/method-specializers-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:accessor-method-slot-definition environment)
  (ld "../../CLOS/accessor-method-slot-definition-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:slot-definition-name environment)
  (ld "../../CLOS/slot-definition-name-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:slot-definition-allocation environment)<commit_msg>Load a file containing auxiliary methods for generic function initialization.<commit_after>(cl:in-package #:sicl-boot-phase2)

(defun ld (filename environment)
  (format *trace-output* "Loading file ~a~%" filename)
  (finish-output *trace-output*)
  (sicl-extrinsic-environment:load-source-with-environments
   (asdf:system-relative-pathname :sicl-boot-phase2 filename)
   (compilation-environment environment)
   environment))

(defun define-ensure-generic-function (environment)
  (setf (sicl-genv:fdefinition 'ensure-generic-function environment)
	(lambda (function-name &rest arguments)
	  (if (sicl-genv:fboundp function-name environment)
	      (sicl-genv:fdefinition function-name environment)
	      (let ((new-arguments (copy-list arguments)))
		(loop while (remf new-arguments :environment))
		(setf (sicl-genv:fdefinition function-name environment)
		      (apply #'make-instance
			     (sicl-genv:find-class
			      'standard-generic-function
			      (phase1-environment environment))
			     new-arguments)))))))

(defun fill-environment (environment)
  (ld "../../CLOS/generic-function-initialization-defmethods.lisp" environment)
  (define-ensure-generic-function environment)
  (sicl-genv:fmakunbound 'sicl-clos:method-function environment)
  (ld "../../CLOS/method-function-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:method-generic-function environment)
  (ld "../../CLOS/method-generic-function-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:method-lambda-list environment)
  (ld "../../CLOS/method-lambda-list-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:method-qualifiers environment)
  (ld "../../CLOS/method-qualifiers-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:method-specializers environment)
  (ld "../../CLOS/method-specializers-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:accessor-method-slot-definition environment)
  (ld "../../CLOS/accessor-method-slot-definition-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:slot-definition-name environment)
  (ld "../../CLOS/slot-definition-name-defgeneric.lisp" environment)
  (sicl-genv:fmakunbound 'sicl-clos:slot-definition-allocation environment)
{'fraction_non_alphanumeric': 0.14423518603582913, 'fraction_numerical': 0.0013780431786862655, 'mean_word_length': 4.648508430609598, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7359869', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1404, 'n_words': 229}