<commit_before>package org.moe.runtime.builtins

import org.moe.runtime._
import org.moe.runtime.nativeobjects._

/**
  * setup class Bool
  */
object BoolClass {

  def apply(r: MoeRuntime): Unit = {
    val env       = new MoeEnvironment(Some(r.getCorePackage.getEnv))
    val boolClass = r.getCoreClassFor("Bool").getOrElse(
      throw new MoeErrors.MoeStartupError("Could not find class Bool")
    )

    import r.NativeObjects._

    def self(e: MoeEnvironment): MoeBoolObject = e.getCurrentInvocantAs[MoeBoolObject].getOrElse(
      throw new MoeErrors.InvocantNotFound("Could not find invocant")
    )

    // MRO: Bool, Scalar, Any, Object

    import r.NativeObjects._

    // moved to coercion section

    // boolClass.addMethod(
    //   new MoeMethod(
    //     "prefix:<+>",
    //     new MoeSignature(),
    //     env,
    //     (e) => getInt(self(e).unboxToInt.getOrElse(0))
    //   )
    // )

    // coercion

    boolClass.addMethod(
      new MoeMethod(
        "Int",
        new MoeSignature(),<commit_msg>remove commented code<commit_after>package org.moe.runtime.builtins

import org.moe.runtime._
import org.moe.runtime.nativeobjects._

/**
  * setup class Bool
  */
object BoolClass {

  def apply(r: MoeRuntime): Unit = {
    val env       = new MoeEnvironment(Some(r.getCorePackage.getEnv))
    val boolClass = r.getCoreClassFor("Bool").getOrElse(
      throw new MoeErrors.MoeStartupError("Could not find class Bool")
    )

    import r.NativeObjects._

    def self(e: MoeEnvironment): MoeBoolObject = e.getCurrentInvocantAs[MoeBoolObject].getOrElse(
      throw new MoeErrors.InvocantNotFound("Could not find invocant")
    )

    // MRO: Bool, Scalar, Any, Object

    import r.NativeObjects._

    // coercion

    boolClass.addMethod(
      new MoeMethod(
        "Int",
        new MoeSignature(),
{'fraction_non_alphanumeric': 0.11636759108210984, 'fraction_numerical': 0.000543773790103317, 'mean_word_length': 2.7474541751527495, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '4150051', 'n_tokens_mistral': 627, 'n_tokens_neox': 593, 'n_words': 126}