1# Release Notes - 3.0.2
2
3## Changes within the distribution
4
5### New classes folder
6
7The root directory of the distribution now contains a classes folder, holding copies of the jpl.* and jpl.fli.* class files
8
9### New demo
10
11In demo/FamilyMT is a new variant of the Family demo which exercises multiple Prolog engines (from a  shared pool)
12called by multiple Java threads.
13
14## C library changes
15
16Lots of refactoring and tidying in preparation for porting (to Linux+gcc initially).
17
18Added Prolog "foreign" functions jpl_c_lib_version/1 and jpl_c_lib_version/4 for making library version identification
19available to Prolog.
20
21Added Java "native" method get_string_chars(), needed if Prolog returns a string to Java
22(which it does sometime even if you don't want it to).
23
24Commented out various unused functions.
25
26Added Java "native" method action_abort() but it doesn't work yet...
27
28Added support for new jpl.JRef type.
29
30## Java API changes
31
32Altered the semantics of Variable to be a purely lexical entity; a Variable instance should be created with a name
33which is valid in Prolog source syntax;
34the argumentless Variable() constructor is currently deprecated and constructs a variable with a "new" name
35in the sequence "_1", "_2" etc. so as not to completely break older programs
36
37Bindings from successful calls are now keyed by the names of the variables, rather than by Variable objects themselves;
38this is part of a revamp to allow goals to be defined by source text fragments.
39
40Implemented the following methods for all Term subclasses (to simplify coding of term checking and traversal etc.):
41
42* type()
43
44  returns jpl.fli.Prolog.ATOM, COMPOUND, FLOAT, INT or VARIABLE
45
46* hasFunctor(String name, int arity)
47
48  fails unless called appropriately;
49
50* intValue(), longValue(), floatValue(), doubleValue()
51
52  yield the Java int value (or long, float or double value respectively) of an Integer or Float instance;
53  each will throw an exception for Atom, Compound and Variable instances;
54  the names of these methods follow the precedent set by java.lang.Integer etc. and remember that a Prolog integer
55  is not equivalent to a Java int (it may be longer or shorter), nor is a Prolog float equivalent to a Java float
56  (it may have a different precision)
57
58* arg(int argNo)
59
60  calling arg() inappropriately (i.e. for jpl.Atom, jpl.Integer, jpl.Float and jpl.Variable instances)
61  throws a runtime exception but is not a compile-time error;
62  this method considers the args to be numbered from 1 upwards (i.e. Prolog convention, not Java array convention)
63
64* name()
65
66  Variable.name() returns the variable's lexical name, Atom.name() and Compound.name() behave as before,
67  Integer.name() and Float.name() each throw an exception if called (but are valid at compile time)
68
69Altered these methods for all Term subclasses:
70
71* toString() now yields a valid (quoted if necessary) Prolog source text representation
72* deprecated Compound.arg0() and all *.debugString() methods
73* deprecated Float.value() (see floatValue() and doubleValue())
74* jpl.Integer now holds a long value (to allow for other/future Prolog implementations with >32-bit integers) but this is backwards compatible if I understand Java correctly...
75* deprecated jpl.Halt() pending a rethink about how best to clean up and terminate a hybrid Java+Prolog application
76* added Query.abort() but it doesn't work yet...
77
78Paul Singleton
79
80Sunday 22nd February 2004
81