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

Summary

Callbacks

Mutates the iterator advancing it to the next element.

Calculates whether the iterator is done or not.

Extracts or calculates the current value.

Types

@type var_ref() :: %Orb.VariableReference{
  global_or_local: term(),
  identifier: 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 value.