PublicShow sourcebackcomp.pl -- Backward compatibility

This library defines predicates that used to exist in older version of SWI-Prolog, but are considered obsolete as there functionality is neatly covered by new features. Most often, these constructs are superceeded by ISO-standard compliant predicates.

Please also note the existence of quintus.pl and edinburgh.pl for more compatibility predicates.

See also
- gxref/0 can be used to find files that import from library(backcomp) and thus reply on deprecated features.
Source$arch(-Architecture, -Version) is det
deprecated
- use current_prolog_flag(arch, Architecture)
Source$version(Version:integer) is det
deprecated
- use current_prolog_flag(version, Version)
Source$home(-SWIPrologDir) is det
See also
- file_search_path/2, absolute_file_name/3, The Prolog home directory is available through the alias swi.
deprecated
- use current_prolog_flag(home, SWIPrologDir)
Source$argv(-Argv:list) is det
deprecated
- use current_prolog_flag(os_argv, Argv) or current_prolog_flag(argv, Argv)
Source$set_prompt(+Prompt) is det
Set the prompt for the toplevel
deprecated
- use set_prolog_flag(toplevel_prompt, Prompt).
Sourcedisplayq(@Term) is det
Sourcedisplayq(+Stream, @Term) is det
Write term ignoring operators and quote atoms.
deprecated
- Use write_term/3 or write_canonical/2.
Sourcesformat(-String, +Format, +Args) is det
Sourcesformat(-String, +Format) is det
deprecated
- Use format/3 as format(string(String), ...)
Sourceconcat(+Atom1, +Atom2, -Atom) is det
deprecated
- Use ISO atom_concat/3
Sourceconcat_atom(+List, -Atom) is det
Concatenate a list of atomic values to an atom.
deprecated
- Use atomic_list_concat/2 as proposed by the prolog commons initiative.
Sourceconcat_atom(+List, +Seperator, -Atom) is det
Concatenate a list of atomic values to an atom, inserting Seperator between each consecutive elements.
deprecated
- Use atomic_list_concat/3 as proposed by the prolog commons initiative.
Source$apropos_match(+Needle, +Haystack) is semidet
True if Needle is a sub atom of Haystack. Ignores the case of Haystack.
Sourceread_clause(-Term) is det
deprecated
- Use read_clause/3 or read_term/3.
Sourceread_clause(+Stream, -Term) is det
deprecated
- Use read_clause/3 or read_term/3.
Sourceread_variables(-Term, -Bindings) is det
Sourceread_variables(+In:stream, -Term, -Bindings) is det
deprecated
- Use ISO read_term/2 or read_term/3.
Sourceread_pending_input(+Stream, -Codes, ?Tail) is det
deprecated
- Use read_pending_codes/3.
Sourcefeature(?Key, ?Value) is nondet
Sourceset_feature(+Key, @Term) is det
Control Prolog flags.
deprecated
- Use ISO current_prolog_flag/2 and set_prolog_flag/2.
Sourcesubstring(+String, +Offset, +Length, -Sub)
Predecessor of sub_string using 1-based Offset.
deprecated
- Use sub_string/5.
Sourcestring_to_list(?String, ?Codes) is det
Bi-directional conversion between a string and a list of character codes.
deprecated
- Use string_codes/2.
Sourcestring_to_atom(?String, ?Atom) is det
Bi-directional conversion between string and atom.
deprecated
- Use atom_string/2. Note that the order of the arguments is reversed.
Sourceflush is det
deprecated
- use ISO flush_output/0.
Sourcewrite_ln(X) is det
deprecated
- Use writeln(X).
Sourceproper_list(+List)
Old SWI-Prolog predicate to check for a list that really ends in a []. There is not much use for the quick is_list, as in most cases you want to process the list element-by-element anyway.
deprecated
- Use ISO is_list/1.
Sourcefree_variables(+Term, -Variables)
Return a list of unbound variables in Term. The name term_variables/2 is more widely used.
deprecated
- Use term_variables/2.
Sourcesubsumes_chk(@Generic, @Specific)
True if Generic can be made equivalent to Specific without changing Specific.
deprecated
- Replace by subsumes_term/2.
Sourcesubsumes(+Generic, @Specific)
True if Generic is unified to Specific without changing Specific.
deprecated
- It turns out that calls to this predicate almost always should have used subsumes_term/2. Also the name is misleading. In case this is really needed, one is adviced to follow subsumes_term/2 with an explicit unification.
Sourcehash_term(+Term, -Hash) is det
If Term is ground, Hash is unified to an integer representing a hash for Term. Otherwise Hash is left unbound.
deprecated
- Use term_hash/2.
Sourcechecklist(:Goal, +List)
deprecated
- Use maplist/2
Sourcesublist(:Goal, +List1, ?List2)
Succeeds if List2 unifies with a list holding those terms for wich call(Goal, Elem) succeeds.
deprecated
- Use include/3 from library(apply)
Compatibility
- DEC10 library
Sourcesumlist(+List, -Sum) is det
True when Sum is the list of all numbers in List.
deprecated
- Use sum_list/2
Source$strip_module(+Term, -Module, -Plain)
This used to be an internal predicate. It was added to the XPCE compatibility library without $ and since then used at many places. From 5.4.1 onwards strip_module/3 is built-in and the $ variation is added here for compatibility.
deprecated
- Use strip_module/3.
Source$module(-OldTypeIn, +NewTypeIn)
Source$declare_module(Module, File, Line)
Used in triple20 particle library. Should use a public interface
Sourceat_initialization(:Goal) is det
Register goal only to be run if a saved state is restored.
deprecated
- Use initialization(Goal, restore)
Sourceconvert_time(+Stamp, -String)
Convert a time-stamp as obtained though get_time/1 into a textual representation using the C-library function ctime(). The value is returned as a SWI-Prolog string object (see section 4.23). See also convert_time/8.
deprecated
- Use format_time/3.
Sourceconvert_time(+Stamp, -Y, -Mon, -Day, -Hour, -Min, -Sec, -MilliSec)
Convert a time stamp, provided by get_time/1, time_file/2, etc. Year is unified with the year, Month with the month number (January is 1), Day with the day of the month (starting with 1), Hour with the hour of the day (0--23), Minute with the minute (0--59). Second with the second (0--59) and MilliSecond with the milliseconds (0--999). Note that the latter might not be accurate or might always be 0, depending on the timing capabilities of the system. See also convert_time/2.
deprecated
- Use stamp_date_time/3.
SourceC(?List, ?Head, ?Tail) is det
Used to be generated by DCG. Some people appear to be using in in normal code too.
deprecated
- Do not use in normal code; DCG no longer generates it.
Sourcecurrent_thread(?Thread, ?Status) is nondet
deprecated
- Replaced by thread_property/2
Sourcecurrent_mutex(?Mutex, ?Owner, ?Count) is nondet
deprecated
- Replaced by mutex_property/2
Sourcemessage_queue_size(+Queue, -Size) is det
True if Queue holds Size terms.
deprecated
- Please use message_queue_property(Queue, Size)
Sourcelock_predicate(+Name, +Arity) is det
Sourceunlock_predicate(+Name, +Arity) is det
deprecated
- see lock_predicate/1 and unlock_predicate/1.
Sourcecurrent_module(?Module, ?File) is nondet
True if Module is a module loaded from File.
deprecated
- Use module_property(Module, file(File))
Sourceexport_list(+Module, -List) is det
Module exports the predicates of List.
deprecated
- Use module_property(Module, exports(List))
Sourcesetup_and_call_cleanup(:Setup, :Goal, :Cleanup)
Call Cleanup once after Goal is finished.
deprecated
- Use setup_call_cleanup/3.
Sourcesetup_and_call_cleanup(:Setup, :Goal, Catcher, :Cleanup)
Call Cleanup once after Goal is finished, with Catcher unified to the reason
deprecated
- Use setup_call_cleanup/3.
Sourcemerge_set(+Set1, +Set2, -Set3)
Merge the ordered sets Set1 and Set2 into a new ordered set without duplicates.
deprecated
- New code should use ord_union/3 from library(ordsets)
Sourcemerge(+List1, +List2, -List3)
Merge the ordered sets List1 and List2 into a new ordered list. Duplicates are not removed and their order is maintained.
deprecated
- The name of this predicate is far too general for a rather specific function.
Sourceindex(:Head) is det
Prepare the predicate indicated by Head for multi-argument indexing.
deprecated
- As of version 5.11.29, SWI-Prolog performs just-in-time indexing on all arguments.
Sourcehash(:PredInd) is det
Demands PredInd to be indexed using a hash-table. This is handled dynamically.
Sourceset_base_module(:Base) is det
Set the default module from whic we inherit.
deprecated
- Equivalent to set_module(base(Base)).
Sourceeval_license is det
deprecated
- Equivalent to license/0
Sourcedisplayq(@Term) is det
Sourcedisplayq(+Stream, @Term) is det
Write term ignoring operators and quote atoms.
deprecated
- Use write_term/3 or write_canonical/2.
Sourcesformat(-String, +Format, +Args) is det
Sourcesformat(-String, +Format) is det
deprecated
- Use format/3 as format(string(String), ...)
Sourceread_variables(-Term, -Bindings) is det
Sourceread_variables(+In:stream, -Term, -Bindings) is det
deprecated
- Use ISO read_term/2 or read_term/3.
Sourcefeature(?Key, ?Value) is nondet
Sourceset_feature(+Key, @Term) is det
Control Prolog flags.
deprecated
- Use ISO current_prolog_flag/2 and set_prolog_flag/2.
Sourcelock_predicate(+Name, +Arity) is det
Sourceunlock_predicate(+Name, +Arity) is det
deprecated
- see lock_predicate/1 and unlock_predicate/1.