Release 4 does not provide a mode in which it is 100% compatible with earlier releases. However, in addition to what is said in What Is New In Release 4 (read that first!), this section provides further guidelines for migrating Prolog code from release 3 to release 4.
Dropped built-in | Replaced by
|
get0/[1,2] , get/[1,2] | get_code/[1,2] , get_byte/[1,2]
|
ttyget0/1 , ttyget/1 | get_code/2 , get_byte/2
|
put/[1,2] , tab/[1,2] | put_code/[1,2] , put_byte/[1,2]
|
ttyput/1 , ttytab/1 | put_code/2 , put_byte/2
|
skip/[1,2] | skip_code/[1,2] , skip_byte/[1,2]
|
ttyskip/1 | skip_code/2 , skip_byte/2
|
ttynl/0 | nl/1
|
ttyflush/0 | flush_output/1
|
fileerrors/0 , nofileerrors/0 | set_prolog_flag/2
|
'C'/3 | unification
|
call_residue/2 | call_residue_vars/2
|
undo/1 | prolog:undo/1
|
help/0 | the message system
|
version/0 | the message system
|
version/1 | the message system
|
fcompile/1 | save_files/2
|
load/1 | load_files/2
|
load_foreign_files/2 | splfr + load_foreign_resource/1
|
require/1 | use_module/2
|
is_mutable/1 | mutable/1
|
module/1 | set_module/1
|
user:term_expansion/[2,4]
and
user:term_expansion/3
are now called
user:term_expansion/6
and Module:term_expansion/5
and have a modified API; see
Term and Goal Expansion.
library(clpb)
, library(clpq)
and library(clpr)
are provided but not supported.
library(flinkage)
and library(spaceout)
are not included
in release 4. library(objects)
has been replaced by its
Quintus counterpart, with a completely different API.
The following table lists the affected SICStus 3 library modules.
Affected module | Closest equivalent | Comment
|
arrays | arrays3 | a
|
assoc | assoc3 | b
|
charsio | codesio | c
|
clpfd | clpfd | d
|
lists | lists3 | e
|
queues | queues3 | f
|
random | random3 | g
|
sockets | sockets | d
|
system | system3 | h
|
terms | terms | d
|
Comments to the table:
library(arrays3)
is a code migration library module;
the long-term solution is to use library(logarrs)
instead.
library(assoc3)
is a code migration library module;
the long-term solution is to use library(avl)
instead.
library(lists3)
is a code migration library module;
the long-term solution is to use library(lists)
instead.
library(queues3)
is a code migration library module;
the long-term solution is to use library(queues)
instead.
library(random3)
is a code migration library module;
the long-term solution is to use library(random)
instead.
library(system3)
is a code migration library module;
the long-term solution is to use library(system)
,
library(file_systems)
and library(process)
instead.
One difference between library(system3)
and the original release
3 version is that exec/3
returns a process reference, a compound
term, instead of an integer process identifier.