An immutable.js-based Bindings object.

Implements

  • Bindings

Constructors

Properties

type: "bindings" = 'bindings'

Accessors

  • get size(): number
  • The number of variable-value pairs.

    Returns number

Methods

  • Returns Iterator<[Variable, Term], any, undefined>

  • Create a new Bindings object by removing the given variable.

    If the variable does not exist in the binding, a copy of the Bindings object is returned.

    Parameters

    • key: string | Variable

      The variable key term or string. If it is a string, no ? prefix must be given.

    Returns Bindings

  • Check if all entries contained in this Bindings object are equal to all entries in the other Bindings object.

    Parameters

    • other: undefined | null | Bindings

      A Bindings object.

    Returns boolean

  • Create a new Bindings object by filtering entries using a callback.

    Parameters

    • fn: (value: Term, key: Variable) => boolean

      A callback that is applied on each entry. Returning true indicates that this entry must be contained in the resulting Bindings object.

    Returns Bindings

  • Iterate over all variable-value pairs.

    Parameters

    • fn: (value: Term, key: Variable) => any

      A callback that is called for each variable-value pair with value as first argument, and variable as second argument.

    Returns void

  • Obtain the binding value for the given variable.

    Parameters

    • key: string | Variable

      A variable term or string. If it is a string, no ? prefix must be given.

    Returns undefined | Term

  • Check if a binding exist for the given variable.

    Parameters

    • key: string | Variable

      A variable term or string. If it is a string, no ? prefix must be given.

    Returns boolean

  • Type Parameters

    • T

    Parameters

    • iterator: Iterator<T, any, undefined>

    Returns Iterable<T>

  • Obtain all variables for which mappings exist.

    Returns Iterable<Variable>

  • Create a new Bindings object by mapping entries using a callback.

    Parameters

    • fn: (value: Term, key: Variable) => Term

      A callback that is applied on each entry, in which the original value is replaced by the returned value.

    Returns Bindings

  • Type Parameters

    • T
    • U

    Parameters

    • iterable: Iterable<T>
    • callback: (value: T) => U

    Returns Iterable<U>

  • Merge this bindings with another.

    If a merge conflict occurs (this and other have an equal variable with unequal value), then undefined is returned.

    Parameters

    • other: Bindings | Bindings

      A Bindings object.

    Returns undefined | Bindings

  • Merge this bindings with another, where merge conflicts can be resolved using a callback function.

    Parameters

    • merger: (self: Term, other: Term, key: Variable) => Term

      A function that is invoked when a merge conflict occurs, for which the returned value is considered the merged value.

    • other: Bindings | Bindings

      A Bindings object.

    Returns Bindings

  • Create a new Bindings object by adding the given variable and value mapping.

    If the variable already exists in the binding, then the existing mapping is overwritten.

    Parameters

    • key: string | Variable

      The variable key term or string. If it is a string, no ? prefix must be given.

    • value: Term

      The value.

    Returns Bindings

  • Returns a string representation of an object.

    Returns string

  • Obtain all values that are mapped to.

    Returns Iterable<Term>