<commit_before>package squid

package object lib {
  
  @transparent
  def IfThenElse[A](cond: Boolean, thn: => A, els: => A): A =
    if (cond) thn else els
  
  @transparent
  def While(cond: => Boolean, loop: => Unit): Unit =
    while (cond) loop
  
  @transparencyPropagating
  def Imperative[A](effects: Any*)(result: A): A = result
  
  @inline @transparent def And(lhs: Boolean, rhs: => Boolean) = lhs && rhs
  @inline @transparent def Or(lhs: Boolean, rhs: => Boolean) = lhs || rhs
  
  
  final class ThunkParam private[lib]()
  private val ThunkParam = new ThunkParam
  def ThunkArg: ThunkParam = ThunkParam
  
  
  abstract class Var[A] {
    def := (that: A) : Unit
    def ! : A
    override def toString = s"Var(${this!})"
  }
  object Var {
    def apply[A](init: A): Var[A] = new Var[A] {
      private[this] var cur = init
      def := (that: A) = cur = that
      def ! = cur
    }
  }
  
  /** Used in ReinterpreterToScala when a local variable "escapes", to preserve the validity and semantics of the program. */
  class VarProxy[A](get: => A, set: A => Unit) extends Var[A] {
    def := (that: A) = set(that)
    def ! = get
  }
  <commit_msg>Fixed equality of virtualized variables<commit_after>package squid

import utils._

package object lib {
  
  @transparent
  def IfThenElse[A](cond: Boolean, thn: => A, els: => A): A =
    if (cond) thn else els
  
  @transparent
  def While(cond: => Boolean, loop: => Unit): Unit =
    while (cond) loop
  
  @transparencyPropagating
  def Imperative[A](effects: Any*)(result: A): A = result
  
  @inline @transparent def And(lhs: Boolean, rhs: => Boolean) = lhs && rhs
  @inline @transparent def Or(lhs: Boolean, rhs: => Boolean) = lhs || rhs
  
  
  final class ThunkParam private[lib]()
  private val ThunkParam = new ThunkParam
  def ThunkArg: ThunkParam = ThunkParam
  
  
  abstract class Var[A] {
    def := (that: A) : Unit
    def ! : A
    override def equals(that: Any) = that |>? { case v: Var[_] => this.! == v.! } Else false
    override def toString = s"Var(${this!})"
  }
  object Var {
    def apply[A](init: A): Var[A] = new Var[A] {
      private[this] var cur = init
      def := (that: A) = cur = that
      def ! = cur
    }
  }
  
  /** Used in ReinterpreterToScala when a local variable "escapes", to preserve the validity and semantics of the program. */
  class VarProxy[A](get: => A, set: A => Unit) extends Var[A] {
    def := (that: A) = set(that)
    def ! = get
  }
  
{'fraction_non_alphanumeric': 0.13914807302231239, 'fraction_numerical': 0.0, 'mean_word_length': 2.9330143540669855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '1679642', 'n_tokens_mistral': 870, 'n_tokens_neox': 868, 'n_words': 278}