protocol
term_io_protocol
ï
Predicates for term input/output from/to atom, chars, and codes. The predicates are declared as synchronized when the library is compiled using a backend supporting threads.
logtalk_load(term_io(loader))
static
Portability notes: To keep calls to these library predicates portable, use only standard read/write options and specify output formats using atoms.
Public predicatesï
read_term_from_atom/3
ï
Reads a term from an atom using the given read options. A period at the end of the atom is optional. Valid options are those supported by the standard read_term/3
predicate.
static, synchronized
read_term_from_atom(Atom,Term,Options)
read_term_from_atom(+atom,-term,+list(read_option))
- one_or_error
read_from_atom/2
ï
Reads a term from an atom using default read options. Shorthand for read_term_from_atom(Atom,Term,[])
. A period at the end of the atom is optional.
static
read_from_atom(Atom,Term)
read_from_atom(+atom,-term)
- one_or_error
read_term_from_chars/3
ï
Reads a term from a list of characters using the given read options. A period at the end of the list is optional. Valid options are those supported by the standard read_term/3
predicate.
static, synchronized
read_term_from_chars(Chars,Term,Options)
read_term_from_chars(+list(character),-term,+list(read_option))
- one_or_error
read_term_from_chars/4
ï
Reads a term from a list of characters using the given read options, also returning the remaining characters. A period at the end of the term is required. Valid options are those supported by the standard read_term/3
predicate.
static
read_term_from_chars(Chars,Term,Tail,Options)
read_term_from_chars(+list(character),-term,-list(character),+list(read_option))
- one_or_error
read_from_chars/2
ï
Reads a term from a list of characters using default read options. Shorthand for read_term_from_chars(Chars,Term,[])
. A period at the end of the list is optional.
static
read_from_chars(Chars,Term)
read_from_chars(+list(character),-term)
- one_or_error
read_term_from_codes/3
ï
Reads a term from a list of character codes using the given read options. A period at the end of the list is optional. Valid options are those supported by the standard read_term/3
predicate.
static, synchronized
read_term_from_codes(Codes,Term,Options)
read_term_from_codes(+list(character_code),-term,+list(read_option))
- one_or_error
read_term_from_codes/4
ï
Reads a term from a list of character codes using the given read options, also returning the remaining character codes. A period at the end of the term is required. Valid options are those supported by the standard read_term/3
predicate.
static
read_term_from_codes(Codes,Term,Tail,Options)
read_term_from_codes(+list(character_code),-term,-list(character_code),+list(read_option))
- one_or_error
read_from_codes/2
ï
Reads a term from a list of character codes using default read options. Shorthand for read_term_from_codes(Codes,Term,[])
. A period at the end of the list is optional.
static
read_from_codes(Codes,Term)
read_from_codes(+list(character_code),-term)
- one_or_error
write_term_to_atom/3
ï
Writes a term to an atom using the given write options. Valid options are those supported by the standard write_term/3
predicate.
static, synchronized
write_term_to_atom(Term,Atom,Options)
write_term_to_atom(@term,-atom,+list(write_option))
- one
write_to_atom/2
ï
Writes a term to an atom using default write options. Shorthand for write_term_to_atom(Term,Atom,[])
.
static
write_to_atom(Term,Atom)
write_to_atom(@term,-atom)
- one
write_term_to_chars/3
ï
Writes a term to a list of characters using the given write options. Shorthand for write_term_to_chars(Term,Chars,[],Options)
. Valid options are those supported by the standard write_term/3
predicate.
static
write_term_to_chars(Term,Chars,Options)
write_term_to_chars(@term,-list(character),+list(write_option))
- one
write_term_to_chars/4
ï
Writes a term to a list of characters with the given tail using the given write options. Valid options are those supported by the standard write_term/3
predicate.
static, synchronized
write_term_to_chars(Term,Chars,Tail,Options)
write_term_to_chars(@term,-list(character),@term,+list(write_option))
- one
write_to_chars/2
ï
Writes a term to a list of characters using default write options. Shorthand for write_term_to_chars(Term,Chars,[],[])
.
static
write_to_chars(Term,Chars)
write_to_chars(@term,-list(character))
- one
write_term_to_codes/3
ï
Writes a term to a list of character codes using the given write options. Shorthand for write_term_to_codes(Term,Codes,[],Options)
. Valid options are those supported by the standard write_term/3
predicate.
static
write_term_to_codes(Term,Codes,Options)
write_term_to_codes(@term,-list(character_code),+list(write_option))
- one
write_term_to_codes/4
ï
Writes a term to a list of character codes with the given tail using the given write options. Valid options are those supported by the standard write_term/3
predicate.
static, synchronized
write_term_to_codes(Term,Codes,Tail,Options)
write_term_to_codes(@term,-list(character_code),@term,+list(write_option))
- one
write_to_codes/2
ï
Writes a term to a list of character codes using default write options. Shorthand for write_term_to_chars(Term,Codes,[],[])
.
static
write_to_codes(Term,Codes)
write_to_codes(@term,-list(character_code))
- one
format_to_atom/3
ï
Writes a list of arguments to an atom using the given format (specified as in the de facto standard format/2
predicate).
static, synchronized
format_to_atom(Format,Arguments,Atom)
format_to_atom(@atom,+list(term),-atom)
- one
format_to_chars/3
ï
Writes a list of arguments to a list of characters using the given format (specified as in the de facto standard format/2
predicate). Shorthand for format_to_chars(Format,Arguments,Chars,[])
.
static
format_to_chars(Format,Arguments,Chars)
format_to_chars(@term,+list(term),-list(character))
- one
format_to_chars/4
ï
Writes a term to a list of characters with the given tail using the given format (specified as in the de facto standard format/2
predicate).
static, synchronized
format_to_chars(Format,Arguments,Chars,Tail)
format_to_chars(@term,+list(term),-list(character),@term)
- one
format_to_codes/3
ï
Writes a list of arguments to a list of character codes using the given format (specified as in the de facto standard format/2
predicate). Shorthand for format_to_codes(Format,Arguments,Codes,[])
.
static
format_to_codes(Format,Arguments,Codes)
format_to_codes(@term,+list(term),-list(character_code))
- one
format_to_codes/4
ï
Writes a list of arguments to a list of character codes with the given tail using the given format (specified as in the de facto standard format/2
predicate).
static, synchronized
format_to_codes(Format,Arguments,Codes,Tail)
format_to_codes(@term,+list(term),-list(character_code),@term)
- one
with_output_to/2
ï
Calls a goal deterministically with output to the given format: atom(Atom)
, chars(Chars)
, chars(Chars,Tail)
, codes(Codes)
, or codes(Codes,Tail)
.
static, synchronized
with_output_to(Output,Goal)
with_output_to(*,0)
with_output_to(+compound,+callable)
- zero_or_one
Protected predicatesï
(none)
Private predicatesï
(none)
Operatorsï
(none)