Options
All
  • Public
  • Public/Protected
  • All
Menu

Binds names in the program source to either

Hierarchy

  • Env

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Env(env?: {}): Env

Properties

Protected env

env: {} = {}

Type declaration

  • [name: string]: string | Cbpv

Methods

bind

  • bind(name: string, addr_or_expr: string | { tag: "cbpv_literal"; v: unknown } | { tag: "cbpv_symbol"; v: string } | { erands: Cbpv[]; op: string; tag: "cbpv_op" } | { exp: Cbpv; tag: "cbpv_suspend" } | { tag: "cbpv_resume"; v: Cbpv } | { args: string[]; body: Cbpv; tag: "cbpv_abstract" } | { erands: Cbpv[]; op: Cbpv; tag: "cbpv_apply" } | { body: Cbpv; exp: Cbpv; tag: "cbpv_let"; v: string[] } | { bindings: [string, Cbpv][]; body: Cbpv; tag: "cbpv_letrec" } | { exp: Cbpv; tag: "cbpv_reset" } | { body: Cbpv; karg: string; tag: "cbpv_shift" } | { c: Cbpv; e: Cbpv; t: Cbpv; tag: "cbpv_if" }): Env
  • Binds an address string or Cbpv definition to the given name.

    Parameters

    • name: string

      The name to which we are binding the second argument.

    • addr_or_expr: string | { tag: "cbpv_literal"; v: unknown } | { tag: "cbpv_symbol"; v: string } | { erands: Cbpv[]; op: string; tag: "cbpv_op" } | { exp: Cbpv; tag: "cbpv_suspend" } | { tag: "cbpv_resume"; v: Cbpv } | { args: string[]; body: Cbpv; tag: "cbpv_abstract" } | { erands: Cbpv[]; op: Cbpv; tag: "cbpv_apply" } | { body: Cbpv; exp: Cbpv; tag: "cbpv_let"; v: string[] } | { bindings: [string, Cbpv][]; body: Cbpv; tag: "cbpv_letrec" } | { exp: Cbpv; tag: "cbpv_reset" } | { body: Cbpv; karg: string; tag: "cbpv_shift" } | { c: Cbpv; e: Cbpv; t: Cbpv; tag: "cbpv_if" }

      Either an address or a definition to bind.

    Returns Env

    This updated environment.

lookup

  • lookup(name: string): string | { tag: "cbpv_literal"; v: unknown } | { tag: "cbpv_symbol"; v: string } | { erands: Cbpv[]; op: string; tag: "cbpv_op" } | { exp: Cbpv; tag: "cbpv_suspend" } | { tag: "cbpv_resume"; v: Cbpv } | { args: string[]; body: Cbpv; tag: "cbpv_abstract" } | { erands: Cbpv[]; op: Cbpv; tag: "cbpv_apply" } | { body: Cbpv; exp: Cbpv; tag: "cbpv_let"; v: string[] } | { bindings: [string, Cbpv][]; body: Cbpv; tag: "cbpv_letrec" } | { exp: Cbpv; tag: "cbpv_reset" } | { body: Cbpv; karg: string; tag: "cbpv_shift" } | { c: Cbpv; e: Cbpv; t: Cbpv; tag: "cbpv_if" }
  • Lookup a name to retrieve either a string address or Cbpv expression.

    throws

    Error If the name is unbound in this environment.

    Parameters

    • name: string

      The name we are looking up.

    Returns string | { tag: "cbpv_literal"; v: unknown } | { tag: "cbpv_symbol"; v: string } | { erands: Cbpv[]; op: string; tag: "cbpv_op" } | { exp: Cbpv; tag: "cbpv_suspend" } | { tag: "cbpv_resume"; v: Cbpv } | { args: string[]; body: Cbpv; tag: "cbpv_abstract" } | { erands: Cbpv[]; op: Cbpv; tag: "cbpv_apply" } | { body: Cbpv; exp: Cbpv; tag: "cbpv_let"; v: string[] } | { bindings: [string, Cbpv][]; body: Cbpv; tag: "cbpv_letrec" } | { exp: Cbpv; tag: "cbpv_reset" } | { body: Cbpv; karg: string; tag: "cbpv_shift" } | { c: Cbpv; e: Cbpv; t: Cbpv; tag: "cbpv_if" }

    Either an address string for use with Store or a definition.

merge

  • Merge the entire contents of the other environment into ours, replacing any conflicting entries with their version.

    Parameters

    Returns Env

    This environment updated with the contents of the other one.

Protected toRecord

  • toRecord(): {}
  • Provides read-only access to the environment map.

    see

    Env.merge

    internal

    Returns {}

    • [name: string]: string | Cbpv

Generated using TypeDoc