name/2
Converts between an atomic term and a char-list
name(Atomic,CharList) -(i,o),(o,i)
?Atomic <number>, <atom> or <string>
?List <char_list> or <variable>
Compatibility: LPA Win-Prolog, all standard Prologs.
Remarks:
1) This predicate converts between atomic data types and character-lists. If Atomic is bound to a number, atom or string, then a list of character codes is unified with List; if Atomic is an unbound variable and List is bound to a list of integers, the latter is assembled into the corresponding Atomic term.
2) This predicate is part of nearly all standard Prologs (including LPA Win-Prolog and Swindon Prolog) and has been included here for reasons of compatibility; however, you can also use "break_atom/2".
3) In standard Prolog implementations, a "list of characters" is effectively a list of ASCII-byte-numbers; and before UniCode arrived these numbers were being distinguished from other numbers by being less than 256. Now, after UniCode, there is a kind of ambiguity problem, if characters and numbers are equated. In LPA Win-Prolog (after about version 4.1), a "char" can be a number as big as any other number. Some other Prolog compilers (e.g. Swindon Prolog) do not even bother to write out the characters resulting from name/2; they produce lists of numbers instead! So what can we do? The chosen way of resolving these problems in G.I.S. Prolog is to use separate domains for characters and numbers. In fact this is wasteful of some memory resources, since with 4-byte alignment the space reserved for a single byte is the same as the space for four bytes. So in the near-future, when Unicode strings will be implemented in G.I.S. Prolog (just as they have been implemented in the latest Visual Prolog 6.2 compiler), characters can be (as in LPA Win-Prolog) of multiple-byte values, while their appearance on the screen will not be numeric, but alphabetic.