<commit_before>(in-package :experimental)

(defmacro def (name args &body body)
  "Same as clamp:def but allows ?, !, ssyntax, and argument 
   destrucuring."
  `(w/ssyntax
    ;; The arguments list has to be expanded manually. Otherwise
    ;; symbols such as ! would be considered ssyntax. The alternative
    ;; would be to put a couple of "patches" into the implementation of
    ;; ssyntax which would ignore those cases.
     ,(mvb (new-args alist) (parse-args args)
        (if (null alist)
            `(defun ,name ,new-args ,@body)
            `(defun ,name ,new-args
               (let ,(map #'cadr alist) (list ,@(map #'car alist))
                 ,@body))))))

(defmacro defmemo (name args &body body)
  "Same as clamp:defmemo but allows ?, !, ssyntax, and argument 
   destrucuring."
  `(w/ssyntax
    ;; The arguments list has to be expanded manually. Otherwise
    ;; symbols such as ! would be considered ssyntax. The alternative
    ;; would be to put a couple of "patches" into the implementation of
    ;; ssyntax which would ignore those cases.
     ,(mvb (new-args alist) (parse-args args)
        (if (null alist)
            `(clamp:defmemo ,name ,new-args ,@body)
            `(clamp:defmemo ,name ,new-args
               (let ,(map #'cadr alist) (list ,@(map #'car alist))
                 ,@body))))))

(defmacro mac (name args &body body)
  "Same as clamp:mac but allows ?, !, ssyntax, and argument 
   destrucuring."
  `(w/ssyntax
    ;; The arguments list has to be expanded manually. Otherwise
    ;; symbols such as ! would be considered ssyntax. The alternative
    ;; would be to put a couple of "patches" into the implementation of
    ;; ssyntax which would ignore those cases.
     ,(mvb (new-args alist) (parse-args args)
        (if (null alist)
            `(defmacro ,name ,new-args ,@body)
            `(defmacro ,name ,new-args
               (let ,(map #'cadr alist) (list ,@(map #'car alist))
                 ,@body))))))<commit_msg>Simplified experimental definitions special forms.<commit_after>(in-package :experimental)

(defmacro defexperimental (old new)
  "Defines a definition special form, NEW, which is the same as the
   definition special form, OLD, except it allows for ssyntax,
   and the new argument lists."
  `(defmacro ,new (name args &body body)
     `(w/ssyntax
        ,(mvb (new-args alist) (parse-args args)
           (if (null alist)
               `(,',old ,name ,new-args ,@body)
               `(,',old ,name ,new-args ,@body
                  (let ,(map #'cadr alist) (list ,@(map #'car alist))
                    ,@body)))))))

(defexperimental def clamp:def)
(defexperimental defmemo clamp:defmemo)
(defexperimental mac clamp:mac)
{'fraction_non_alphanumeric': 0.12135743268166728, 'fraction_numerical': 0.0, 'mean_word_length': 2.6208277703604805, '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': '730193', 'n_tokens_mistral': 878, 'n_tokens_neox': 838, 'n_words': 306}