<commit_before>package gnu.mapping;

/**
 * The abstract parent for all Scheme functions.
 * @author  <NAME>
 */

public abstract class Procedure extends Named implements Printable
{
  public static Object[] noArgs = new Object[0];

  public Procedure()
  {
    super ();
  }

  public Procedure(String n)
  {
    super(n);
  }

  public abstract Object applyN (Object[] args);

  public abstract Object apply0 ();

  public abstract Object apply1 (Object arg1);

  public abstract Object apply2 (Object arg1,Object arg2);

  public abstract Object apply3 (Object arg1, Object arg2, Object arg3);

  public abstract Object apply4(Object arg1,Object arg2,
				Object arg3,Object arg4);

  public final int minArgs() { return numArgs() & 0xFFF; }
  public final int maxArgs() { return numArgs() >> 12; }

  /** Check that the number of arguments in a call is valid.
    * @param proc the Procedure being called
    * @param argCount the number of arguments in the call
    * @return nothing, if the number of arguments is ok
    * @exception WrongArguments there are too many or too
    *     few actual arguments
    */
  public static void checkArgCount(Procedure proc, int argCount)
  {
    int num = proc.numArgs();
    if (argCount < (num & 0xFFF)
	|| (num >= 0 && argCount > (num >> 12)))
      throw new WrongArguments(proc, argCount);
  }

  /** Return minArgs()|(maxArgs<<12). */

  /* We use a single virtual function to reduce the number of methods
   * in the system, as well as the number of virtual method table entries.
   * We shift by 12 so the number can normally be represented using a
   * sipush instruction, without requiring a constant pool entry.
   */
  public int numArgs() { return 0xfffff000; }

  /* CPS: ??
  public void apply1(Object arg, CallStack stack, CallFrame rlink, int rpc)
  {<commit_msg>Add comments.<commit_after>package gnu.mapping;

/**
 * The abstract parent for all Scheme functions.
 * @author  <NAME>
 */

public abstract class Procedure extends Named implements Printable
{
  public static Object[] noArgs = new Object[0];

  public Procedure()
  {
    super ();
  }

  public Procedure(String n)
  {
    super(n);
  }

  public abstract Object applyN (Object[] args);

  public abstract Object apply0 ();

  public abstract Object apply1 (Object arg1);

  public abstract Object apply2 (Object arg1,Object arg2);

  public abstract Object apply3 (Object arg1, Object arg2, Object arg3);

  public abstract Object apply4(Object arg1,Object arg2,
				Object arg3,Object arg4);

  /** Minimum number of arguments required. */
  public final int minArgs() { return numArgs() & 0xFFF; }

  /** Maximum number of arguments allowed, or -1 for unlimited. */
  public final int maxArgs() { return numArgs() >> 12; }

  /** Check that the number of arguments in a call is valid.
    * @param proc the Procedure being called
    * @param argCount the number of arguments in the call
    * @return nothing, if the number of arguments is ok
    * @exception WrongArguments there are too many or too
    *     few actual arguments
    */
  public static void checkArgCount(Procedure proc, int argCount)
  {
    int num = proc.numArgs();
    if (argCount < (num & 0xFFF)
	|| (num >= 0 && argCount > (num >> 12)))
      throw new WrongArguments(proc, argCount);
  }

  /** Return minArgs()|(maxArgs<<12). */

  /* We use a single virtual function to reduce the number of methods
   * in the system, as well as the number of virtual method table entries.
   * We shift by 12 so the number can normally be represented using a
   * sipush instruction, without requiring a constant pool entry.
   */
  public int numArgs() { return 0xfffff000; }

  /* CPS: ??
  public void apply1(Object arg, CallStack stack, CallFrame rlink, int rpc)
  {
{'fraction_non_alphanumeric': 0.09370852136979028, 'fraction_numerical': 0.017255110167241836, 'mean_word_length': 3.3260619977037886, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '5771553', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1047, 'n_words': 457}