Module aya.base

Record Class LocalLet

java.lang.Object
java.lang.Record
org.aya.tyck.ctx.LocalLet
All Implemented Interfaces:
org.aya.util.Scoped<org.aya.syntax.ref.LocalVar,Jdg,LocalLet>

public record LocalLet(@Nullable LocalLet parent, @NotNull kala.collection.mutable.MutableLinkedHashMap<org.aya.syntax.ref.LocalVar,Jdg> subst) extends Record implements org.aya.util.Scoped<org.aya.syntax.ref.LocalVar,Jdg,LocalLet>
A locally, lazy substitution
Every substitution should be well-scoped, i.e., Jdg can only refer to some free variable or elder lazy substitution.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    LocalLet(@Nullable LocalLet parent, @NotNull kala.collection.mutable.MutableLinkedHashMap<org.aya.syntax.ref.LocalVar,Jdg> subst)
    Creates an instance of a LocalLet record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull LocalLet
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NotNull kala.control.Option<Jdg>
    getLocal(@NotNull org.aya.syntax.ref.LocalVar key)
     
    final int
    Returns a hash code value for this object.
    @Nullable LocalLet
    Returns the value of the parent record component.
    void
    putLocal(@NotNull org.aya.syntax.ref.LocalVar key, @NotNull Jdg value)
     
    @NotNull LocalLet
     
    @NotNull kala.collection.mutable.MutableLinkedHashMap<org.aya.syntax.ref.LocalVar,Jdg>
    Returns the value of the subst record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.aya.util.Scoped

    contains, containsLocal, fold, get, put
  • Constructor Details

    • LocalLet

      public LocalLet()
    • LocalLet

      public LocalLet(@Nullable @Nullable LocalLet parent, @NotNull @NotNull kala.collection.mutable.MutableLinkedHashMap<org.aya.syntax.ref.LocalVar,Jdg> subst)
      Creates an instance of a LocalLet record class.
      Parameters:
      parent - the value for the parent record component
      subst - the value for the subst record component
  • Method Details

    • self

      @NotNull public @NotNull LocalLet self()
      Specified by:
      self in interface org.aya.util.Scoped<org.aya.syntax.ref.LocalVar,Jdg,LocalLet>
    • derive

      @NotNull public @NotNull LocalLet derive()
      Specified by:
      derive in interface org.aya.util.Scoped<org.aya.syntax.ref.LocalVar,Jdg,LocalLet>
    • getLocal

      @NotNull public @NotNull kala.control.Option<Jdg> getLocal(@NotNull @NotNull org.aya.syntax.ref.LocalVar key)
      Specified by:
      getLocal in interface org.aya.util.Scoped<org.aya.syntax.ref.LocalVar,Jdg,LocalLet>
    • putLocal

      public void putLocal(@NotNull @NotNull org.aya.syntax.ref.LocalVar key, @NotNull @NotNull Jdg value)
      Specified by:
      putLocal in interface org.aya.util.Scoped<org.aya.syntax.ref.LocalVar,Jdg,LocalLet>
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • parent

      @Nullable public @Nullable LocalLet parent()
      Returns the value of the parent record component.
      Specified by:
      parent in interface org.aya.util.Scoped<org.aya.syntax.ref.LocalVar,Jdg,LocalLet>
      Returns:
      the value of the parent record component
    • subst

      @NotNull public @NotNull kala.collection.mutable.MutableLinkedHashMap<org.aya.syntax.ref.LocalVar,Jdg> subst()
      Returns the value of the subst record component.
      Returns:
      the value of the subst record component