Skip to main content

Module atomops

Module atomops 

Source
Expand description

Atom/number-string builtins: atom_length/2, atom_chars/2, number_chars/2, number_codes/2.

Modes follow ISO. Notes:

  • atom_concat/3 is nondeterministic (split mode) and so lives with the other predicate-dispatched builtins in control.rs, not here.
  • atom_chars/2 works both directions (atom→one-char atoms, list→atom).
  • number_chars/2 and number_codes/2 work both directions; garbage input on the reverse direction raises a bare syntax_error formal.
  • float→chars/codes uses v1’s format_float (“3.0”, not “3”).

Functions§

plg_rt_b_atom_chars_2
atom_chars/2: both directions (atom ↔ list of one-char atoms).
plg_rt_b_atom_length_2
atom_length/2: length (in chars) of an atom. 1 = success.
plg_rt_b_number_chars_2
number_chars/2: both directions (number ↔ list of one-char atoms).
plg_rt_b_number_codes_2
number_codes/2: both directions (number ↔ list of char codes).