<commit_before>(in-package :parenscript)

(define-condition simple-style-warning (simple-condition style-warning)
  ())

(defun warn-deprecated (old-name &optional new-name)
  (warn 'simple-style-warning
        :format-control "~:@(~a~) is deprecated~:[.~;, use ~:@(~a~) instead~]"
        :format-arguments (list old-name new-name new-name)))

;;; DEPRECATED INTERFACE ;;;

(defun js-equal (a b)
  (warn-deprecated 'js-equal 'script-equal)
  (script-equal a b))

(defun js-compile (form)
  (warn-deprecated 'js-compile 'compile-script)
  (compile-script form :output-spec :javascript))

(defun js-compile-list (form)
  (warn-deprecated 'js-compile-list 'compile-script)
  (compile-script form :output-spec :javascript))

(defmacro defjsmacro (&rest args)
  (warn-deprecated 'defjsmacro 'defpsmacro)
  `(defscriptmacro ,@args))<commit_msg>Started work on implementing deprecated compatibility interface by <NAME> idea.<commit_after>(in-package :parenscript)

(define-condition simple-style-warning (simple-condition style-warning)
  ())

(defun warn-deprecated (old-name &optional new-name)
  (warn 'simple-style-warning
        :format-control "~:@(~a~) is deprecated~:[.~;, use ~:@(~a~) instead~]"
        :format-arguments (list old-name new-name new-name)))

(defmacro without-packages (&body body)
  `(let ((ps:*enable-package-system* nil))
    ,@body))

(defmacro defun-js (old-name new-name args &body body)
  `(defun ,old-name ,args
    ,(when (and (stringp (car body)) (< 1 (length body))) ;; docstring
           (car body))
    (warn-deprecated ',old-name ',new-name)
    (without-packages ,@body)))

;;; DEPRECATED INTERFACE ;;;

(defun-js js-equal script-equal (a b)
  (script-equal a b))

(defun-js js-compile compile-script (form)
  (compile-script form :output-spec :javascript))

(defun-js js-compile-list compile-script (form)
  (compile-script form :output-spec :javascript))

(defmacro defjsmacro (&rest args)
  (warn-deprecated 'defjsmacro 'defpsmacro)
  `(defscriptmacro ,@args))
{'fraction_non_alphanumeric': 0.16533466533466534, 'fraction_numerical': 0.0004995004995004995, 'mean_word_length': 4.398921832884097, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '2204080', 'n_tokens_mistral': 706, 'n_tokens_neox': 686, 'n_words': 168}