Support the implementation of automatic completion as found with class text_item.
The chain is a chain of elements from which one has to be chosen by
means of completion. Prefix is the string typed so far.
Extract_name is a function to extract the name from the each
element. Its values are:
The return value is a tuple
object. The tuple<-first contains a new
chain holding all elements of the receiving string whose name start with
the given prefix. The tuple<-second
contains a new string
object holding the largest common prefix of all matches. If no element
of the chain matches prefix, this method fails. Example:
?- get(chain(gnu, foo, gnats, bar), complete_name, 'g',
tuple(Matches, string(Common))),
object(Matches, Chain).
Common = gn
Chain = chain(gnu, gnats)
Matches = @854357/chain
See also text_item->complete.