cat/3
Joins or splits atoms or strings
cat(Parts,Whole,Joins) -(i,o,o),(o,i,i)
?Parts <list> or <variable>
?Whole <string> or <atom> or <variable>
?Joins <list> or <variable>
Compatibility: LPA Win-Prolog.
This predicate can be used to join an arbitrary number of strings or atoms together, or to split an atom or string into an arbitrary number of parts.
Remarks:
1) The "cat/3" predicate is a powerful built-in predicate of LPA WIN-Prolog (http://www.lpa.co.uk). It is included here in exactly the same form, so that any programs written for LPA Win-Prolog, which include this predicate, can also run correctly in G.I.S. Prolog.
2) When joining (concatenating) text items, Parts must be bound to a list containing atoms or strings (but not both), and Whole and Joins must be unbound variables. The predicate succeeds by returning a single atom or string in Whole, together with a list of integers in Joins, which describes where to split the resulting atom or string in order to restore the original list.
3) When splitting (separating) an atom or a string into a list of components, Parts must be an unbound variable, and Whole and Joins must be bound to an atom or string and a list of integers respectively. The predicate succeeds by returning the list of atoms or strings that is obtained by splitting the given atom or string at the specified split points.