<commit_before>;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; indent-tabs-mode: nil -*-

;;;; This file is part of Sheeple
;;;;
;;;; This software is derived from the SBCL system. See COPYING for more information
;;;;
;;;; This software is derived from the CMU CL system, which was
;;;; written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provided with absolutely no warranty. See the COPYING for
;;;; more information.

(in-package :sheeple)

(defun kludge-arglist (lambda-list)
  (when (find '&key lambda-list)
    (unless (find '&allow-other-keys lambda-list)
      (setf lambda-list (append lambda-list '(&allow-other-keys)))))
  lambda-list)

;;; Break something like a lambda list (but not necessarily actually a
;;; lambda list, e.g. the representation of argument types which is
;;; used within an FTYPE specification) into its component parts. We
;;; return twelve values:
;;;  1. a list of the required args;
;;;  2. a list of the &OPTIONAL arg specs;
;;;  3. true if a &REST arg was specified;
;;;  4. the &REST arg;
;;;  5. true if &KEY args are present;
;;;  6. a list of the &KEY arg specs;
;;;  7. true if &ALLOW-OTHER-KEYS was specified.;<commit_msg>LAMBDA-LISTS: Better handling of &aux when &key and &aok are involved<commit_after>;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; indent-tabs-mode: nil -*-

;;;; This file is part of Sheeple
;;;;
;;;; This software is derived from the SBCL system. See COPYING for more information
;;;;
;;;; This software is derived from the CMU CL system, which was
;;;; written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provided with absolutely no warranty. See the COPYING for
;;;; more information.

(in-package :sheeple)

(defun kludge-arglist (lambda-list)
  (when (find '&key lambda-list)
    (unless (find '&allow-other-keys lambda-list)
      (setf lambda-list
            (aif (position '&aux lambda-list)
                 (concatenate 'list (subseq lambda-list 0 it) '(&allow-other-keys) (subseq lambda-list it))
                 (append lambda-list '(&allow-other-keys))))))
  lambda-list)

;;; Break something like a lambda list (but not necessarily actually a
;;; lambda list, e.g. the representation of argument types which is
;;; used within an FTYPE specification) into its component parts. We
;;; return twelve values:
;;;  1. a list of the required args;
;;;  2. a list of the &OPTIONAL arg specs;
;;;  3. true if a &REST arg was specified;
;;;  4. the &REST arg;
;;;  5. true if &KEY args are present;
;;;  6. a list of the &KEY arg specs;
;;;  7. true if &ALLOW-OTHER-KEYS was specified.;
{'fraction_non_alphanumeric': 0.1320409656181419, 'fraction_numerical': 0.006949524506217996, 'mean_word_length': 3.675213675213675, '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': '7352897', 'n_tokens_mistral': 862, 'n_tokens_neox': 818, 'n_words': 365}