View Source Orb.Iterator behaviour (Orb v0.1.1)

Summary

Callbacks

Mutates the iterator advancing it to the next element.

Calculates whether the iterator is done or not.

Extracts or calculates the current element value.

The type for iterated elements.

Types

@type var_ref() :: %Orb.VariableReference{
  entries: term(),
  pop_type: term(),
  push_type: term()
}

Callbacks

@callback next(var_ref()) ::
  %Orb.Instruction{
    operands: term(),
    operation: term(),
    pop_type: term(),
    push_type: term()
  }
  | integer()
  | float()

Mutates the iterator advancing it to the next element.

@callback valid?(var_ref()) ::
  %Orb.Instruction{
    operands: term(),
    operation: term(),
    pop_type: term(),
    push_type: term()
  }
  | integer()

Calculates whether the iterator is done or not.

@callback value(var_ref()) ::
  %Orb.Instruction{
    operands: term(),
    operation: term(),
    pop_type: term(),
    push_type: term()
  }
  | integer()
  | float()

Extracts or calculates the current element value.

@callback value_type() :: atom() | tuple()

The type for iterated elements.