<commit_before>;;;;; Transpiler: TRE to PHP
;;;;; Copyright (c) 2008-2011 <NAME> <<EMAIL>>

(dont-obfuscate apply call function_exists call_user_func_array array)

(defun apply (&rest lst)
  (with (fun lst.
         l (last .lst)
         args (%nconc (butlast .lst) l.)
         funref? (is_a fun "__funref")
         fun-name (if funref?
                      (%%%string+ "userfun_" fun.n)
                      fun)
         expander-name (%%%string+ fun-name "_treexp"))
    (when funref?
      (setf args (cons fun.g args)))
	(if (function_exists expander-name)
	    (call_user_func_array expander-name (%transpiler-native "array ($" args ")"))
        (call_user_func_array fun-name (list-array args)))))

(defmacro cps-wrap (x) x)
(defun cps-return-dummy (&rest x))

(defun funcall (fun &rest args)
  (apply fun args))<commit_msg>Issue error if function doesn't exists (so we can see the erraneous function name).<commit_after>;;;;; Transpiler: TRE to PHP
;;;;; Copyright (c) 2008-2011 <NAME> <<EMAIL>>

(dont-obfuscate apply call function_exists call_user_func_array array)

(defun apply (&rest lst)
  (with (fun lst.
         l (last .lst)
         args (%nconc (butlast .lst) l.)
         funref? (is_a fun "__funref")
         fun-name (if funref?
                      (%%%string+ "userfun_" fun.n)
                      fun)
         expander-name (%%%string+ fun-name "_treexp"))
    (when funref?
      (setf args (cons fun.g args)))
	(if
      (function_exists expander-name)
	    (call_user_func_array expander-name (%transpiler-native "array ($" args ")"))
	  (function_exists fun-name)
        (call_user_func_array fun-name (list-array args))
      (error (+ "Function '" fun-name "' does not exist.")))))

(defmacro cps-wrap (x) x)
(defun cps-return-dummy (&rest x))

(defun funcall (fun &rest args)
  (apply fun args))
{'fraction_non_alphanumeric': 0.14782608695652175, 'fraction_numerical': 0.008695652173913044, 'mean_word_length': 2.757142857142857, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5041499', 'n_tokens_mistral': 656, 'n_tokens_neox': 630, 'n_words': 182}