Nock (Anoma v0.34.0)

Nock, a universal function on nouns.

Summary

Types

t()

I contain environmental information on how Nock shall be evaluated.

Types

error()

@type error() ::
  :crash_bang
  | :scry_no_return
  | :scry_forbidden
  | :jet_does_not_match
  | :invalid_instruction
  | :instruction_match_error
  | {:jet_failed, Nock.Jets.error()}
  | {:scry_failure, any()}
  | {:scry_failure_formula, error()}
  | {:invalid_formula, Noun.t()}
  | {:inc_non_atom, Noun.t()}
  | {:gas, non_neg_integer()}
  | {:axis, Noun.t(), Noun.t()}
  | {:invalid_formula, Noun.t()}
  | {:replace, Noun.t(), Noun.t(), Noun.t()}
  | {:gas_error, error(), non_neg_integer()}

t()

@type t() :: %Nock{
  gas_limit: non_neg_integer() | nil,
  meter_pid: pid() | nil,
  scry_function: (term() -> {:ok, term()} | {:error, any()}),
  stdio: any()
}

I contain environmental information on how Nock shall be evaluated.

For example Ι contain information on jettedness to determine if we should be using jets or not

Functions

cons(a, b)

@spec cons(Noun.t(), Noun.t()) :: Noun.t()

decrement_arm()

@spec decrement_arm() :: Noun.t()

decrement_core()

@spec decrement_core() :: Noun.t()

gas_limit(limit, pid, gas)

gas_meter()

@spec gas_meter() :: non_neg_integer()

gas_meter(gas)

@spec gas_meter(non_neg_integer()) :: non_neg_integer()

get_jet(battery_mug)

@spec get_jet(Noun.t()) ::
  {:ok,
   {String.t(), non_neg_integer(), non_neg_integer(),
    (Noun.t() -> {:error, Nock.Jets.error()} | {:ok, Noun.t()}), atom(),
    non_neg_integer()}}
  | :error

metered_nock(subject, formula)

@spec metered_nock(Noun.t(), Noun.t()) ::
  {:ok, Noun.t(), non_neg_integer()} | {:error, error()}

metered_nock(subject, formula, environment)

@spec metered_nock(Noun.t(), Noun.t(), t()) ::
  {:ok, Noun.t(), non_neg_integer()} | {:error, error()}

naive_nock(subject, formula)

@spec naive_nock(Noun.t(), Noun.t()) :: {:ok, Noun.t()} | {:error, error()}

naive_nock(subject, formula, environment)

@spec naive_nock(Noun.t(), Noun.t(), t()) :: {:ok, Noun.t()} | {:error, error()}

nock(subject, formula)

@spec nock(Noun.t(), Noun.t()) :: {:ok, Noun.t()} | {:error, error()}

nock(subject, formula, env)

@spec nock(Noun.t(), Noun.t(), t()) :: {:ok, Noun.t()} | {:error, error()}

nock_0(axis)

@spec nock_0(Noun.t()) :: Noun.t()

nock_1(constant)

@spec nock_1(Noun.t()) :: Noun.t()

nock_2(subject_formula, formula_formula)

@spec nock_2(Noun.t(), Noun.t()) :: Noun.t()

nock_3(sub_formula)

@spec nock_3(Noun.t()) :: Noun.t()

nock_4(sub_formula)

@spec nock_4(Noun.t()) :: Noun.t()

nock_5(formula_1, formula_2)

@spec nock_5(Noun.t(), Noun.t()) :: Noun.t()

nock_6(cond, true_branch, false_branch)

@spec nock_6(Noun.t(), Noun.t(), Noun.t()) :: Noun.t()

nock_7(subject_formula, sub_formula)

@spec nock_7(Noun.t(), Noun.t()) :: Noun.t()

nock_8(push_formula, sub_formula)

@spec nock_8(Noun.t(), Noun.t()) :: Noun.t()

nock_9(axis, sub_formula)

@spec nock_9(Noun.t(), Noun.t()) :: Noun.t()

nock_10(axis, replacement_formula, sub_formula)

@spec nock_10(Noun.t(), Noun.t(), Noun.t()) :: Noun.t()

nock_11(hint_noun, sub_formula)

@spec nock_11(Noun.t(), Noun.t()) :: Noun.t()

nock_11(hint_noun, hint_formula, sub_formula)

@spec nock_11(Noun.t(), Noun.t(), Noun.t()) :: Noun.t()

process_hint(_)

@spec process_hint(Noun.t()) :: term()

process_hint(puts, hint_result, environment)

@spec process_hint(Noun.t(), Noun.t(), t()) :: term()

put_jet(battery_mug, jet_info)

@spec put_jet(Noun.t(), any()) :: any()

scry_forbidden(_)

@spec scry_forbidden(Noun.t()) :: {:error, :scry_forbidden} | {:ok, Noun.t()}