Go to the first, previous, next, last section, table of contents.


Basic predicates handling names of constants

Version: 1.5#118 (2000/4/19, 18:13:43 CEST)

The Ciao system provides builtin predicates which allow dealing with names of constants (atoms or numbers). As an atom name must be of less than 512 characters, to handle sequences of more characters, strings (character code lists) must be used.

Usage and interface (atomic_basic)

Documentation on exports (atomic_basic)

PREDICATE: name/2:

name(Const,String)

String is the list of the ASCII codes of the characters comprising the name of Const. Note that if Const is an atom whose name can be interpreted as a number (e.g. '96'), the predicate is not reversible, as that atom will not be constructed when Const is uninstantiated. Thus it is recommended that new programs use the ISO-compliant predicates atom_codes/2 or number_codes/2, as these predicates do not have this inconsistency.

Usage 2: name(-(constant),+string)

Usage 3:

Usage 4:

PREDICATE: atom_codes/2:

atom_codes(Atom,String)

String is the list of the ASCII codes of the characters comprising the name of Atom.

Usage 3: * ISO *

Usage 4: * ISO *

PREDICATE: number_codes/2:

number_codes(Number,String)

String is the list of the ASCII codes of the characters comprising a representation of Number.

Usage 3: * ISO *

Usage 4: * ISO *

PREDICATE: number_codes/3:

number_codes(Number,String,Base)

String is the list of the ASCII codes of the characters comprising a representation of Number in base Base.

Usage 3:

Usage 4:

PREDICATE: atom_length/2:

atom_length(Atom,Length)

Length is the number of characters forming the name of Atom.

Usage 2: * ISO *

PREDICATE: atom_concat/3:

atom_concat(Atom_1,Atom_2,Atom_12)

Atom_12 is the result of concatenating Atom_1 followed by Atom_2.

Usage 1: atom_concat(+atom,+atom,?(atom)) * ISO *

Usage 2: atom_concat(-(atom),-(atom),+atom) * ISO *

Usage 3: atom_concat(-(atom),+atom,+atom) * ISO *

Usage 4: atom_concat(+atom,-(atom),+atom) * ISO *

Usage 5: * ISO *

Usage 6: * ISO *

Usage 7: * ISO *

Usage 8: * ISO *

PREDICATE: sub_atom/4:

sub_atom(Atom,Before,Length,Sub_atom)

Sub_atom is formed with Length consecutive characters of Atom after the Before character.

Usage 2:


Go to the first, previous, next, last section, table of contents.