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 superseded 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).
Source displayq(@Term) is det
Source displayq(+Stream, @Term) is det
Write term ignoring operators and quote atoms.
deprecated
- Use write_term/3 or write_canonical/2.
Source sformat(-String, +Format, +Args) is det
Source sformat(-String, +Format) is det
deprecated
- Use format/3 as format(string(String), ...)
Source concat(+Atom1, +Atom2, -Atom) is det
deprecated
- Use ISO atom_concat/3
Source concat_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.
Source concat_atom(+List, +Separator, -Atom) is det
Concatenate a list of atomic values to an atom, inserting Separator 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.
Source read_clause(-Term) is det
deprecated
- Use read_clause/3 or read_term/3.
Source read_clause(+Stream, -Term) is det
deprecated
- Use read_clause/3 or read_term/3.
Source read_variables(-Term, -Bindings) is det
Source read_variables(+In:stream, -Term, -Bindings) is det
deprecated
- Use ISO read_term/2 or read_term/3.
Source read_pending_input(+Stream, -Codes, ?Tail) is det
deprecated
- Use read_pending_codes/3.
Source feature(?Key, ?Value) is nondet
Source set_feature(+Key, @Term) is det
Control Prolog flags.
deprecated
- Use ISO current_prolog_flag/2 and set_prolog_flag/2.
Source substring(+String, +Offset, +Length, -Sub)
Predecessor of sub_string using 1-based Offset.
deprecated
- Use sub_string/5.
Source string_to_list(?String, ?Codes) is det
Bi-directional conversion between a string and a list of character codes.
deprecated
- Use string_codes/2.
Source string_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.
Source flush is det
deprecated
- use ISO flush_output/0.
Source write_ln(X) is det
deprecated
- Use writeln(X).
Source proper_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.
Source free_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.
Source hash_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.
Source checklist(:Goal, +List)
deprecated
- Use maplist/2
Source sublist(:Goal, +List1, ?List2)
Succeeds if List2 unifies with a list holding those terms for which call(Goal, Elem) succeeds.
deprecated
- Use include/3 from library(apply)
Compatibility
- DEC10 library
Source sumlist(+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
Source at_initialization(:Goal) is det
Register goal only to be run if a saved state is restored.
deprecated
- Use initialization(Goal, restore)
Source convert_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.
Source convert_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.
Source C(?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.
Source current_thread(?Thread, ?Status) is nondet
deprecated
- Replaced by thread_property/2
Source current_mutex(?Mutex, ?Owner, ?Count) is nondet
deprecated
- Replaced by mutex_property/2
Source message_queue_size(+Queue, -Size) is det
True if Queue holds Size terms.
deprecated
- Please use message_queue_property(Queue, Size)
Source lock_predicate(+Name, +Arity) is det
Source unlock_predicate(+Name, +Arity) is det
deprecated
- see lock_predicate/1 and unlock_predicate/1.
Source current_module(?Module, ?File) is nondet
True if Module is a module loaded from File.
deprecated
- Use module_property(Module, file(File))
Source export_list(+Module, -List) is det
Module exports the predicates of List.
deprecated
- Use module_property(Module, exports(List))
Source call_cleanup(:Goal, +Catcher, :Cleanup)
Call Cleanup with an indication of the reason unified to Catcher.
deprecated
- Use setup_call_catcher_cleanup/4.
Source setup_and_call_cleanup(:Setup, :Goal, :Cleanup)
Call Cleanup once after Goal is finished.
deprecated
- Use setup_call_cleanup/3.
Source setup_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.
Source merge_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)
Source merge(+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.
Source index(: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.
Source hash(:PredInd) is det
Demands PredInd to be indexed using a hash-table. This is handled dynamically.
Source set_base_module(:Base) is det
Set the default module from which we inherit.
deprecated
- Equivalent to set_module(base(Base)).
Source eval_license is det
deprecated
- Equivalent to license/0
Source trie_insert_new(+Trie, +Term, -Handle) is semidet
deprecated
- use trie_insert/4.
Source thread_at_exit(:Goal) is det
Register Goal to be called when the calling thread exits. @deprecated use prolog_listen(this_thread_exit, Goal)
Source read_history(+Show, +Help, +Special, +Prompt, -Term, -Bindings)
deprecated
- use read_term_with_history/2.
Source $sig_atomic(:Goal)
Execute Goal without processing signals.
deprecated
- use sig_atomic/1.

Re-exported predicates

The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.

Source displayq(@Term) is det
Source displayq(+Stream, @Term) is det
Write term ignoring operators and quote atoms.
deprecated
- Use write_term/3 or write_canonical/2.
Source sformat(-String, +Format, +Args) is det
Source sformat(-String, +Format) is det
deprecated
- Use format/3 as format(string(String), ...)
Source read_variables(-Term, -Bindings) is det
Source read_variables(+In:stream, -Term, -Bindings) is det
deprecated
- Use ISO read_term/2 or read_term/3.
Source feature(?Key, ?Value) is nondet
Source set_feature(+Key, @Term) is det
Control Prolog flags.
deprecated
- Use ISO current_prolog_flag/2 and set_prolog_flag/2.
Source lock_predicate(+Name, +Arity) is det
Source unlock_predicate(+Name, +Arity) is det
deprecated
- see lock_predicate/1 and unlock_predicate/1.