46 lines
1.7 KiB
HTML
46 lines
1.7 KiB
HTML
<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type"
|
|
content="text/html; charset=iso-8859-1">
|
|
<meta name="GENERATOR"
|
|
content="Mozilla/4.74 [en] (WinNT; U) [Netscape]">
|
|
<title>JPL 3.x Java-calls-Prolog gotchas</title>
|
|
</head>
|
|
<body>
|
|
<h1><span style="font-style: italic;">
|
|
JPL 3.x</span> Java API gotchas
|
|
</h1>
|
|
<hr width="100%">
|
|
<h2>arg indexing</h2>
|
|
<blockquote>the <span style="font-weight: bold;">Term[]</span> args of
|
|
a <span style="font-weight: bold;">Compound</span> are indexed (like
|
|
all Java arrays) from zero, whereas in Prolog the args of a structure
|
|
are conventionally numbered from one.<br>
|
|
</blockquote>
|
|
<h2>representing <span style="font-family: monospace;">@(null)</span><br>
|
|
</h2>
|
|
<blockquote>there is no <span style="font-weight: bold;">jpl.JNull</span>
|
|
class: instead, use <span style="font-family: monospace;">new
|
|
JRef(null)</span> to represent <span style="font-family: monospace;">@(null)</span>
|
|
(which itself represents Java's <span style="font-style: italic;">null</span>).
|
|
If you don't know what this all means, don't worry: it only affects
|
|
those writing hybrid Java+Prolog programs which call each other
|
|
nestedly.<br>
|
|
</blockquote>
|
|
<h2>all solutions of a Query with no solutions</h2>
|
|
<div style="margin-left: 40px;"><span style="font-weight: bold;">Query.allSolutions()</span>
|
|
now returns an empty array of <span style="font-weight: bold;">Map</span>
|
|
if the <span style="font-weight: bold;">Query</span> has no solutions
|
|
(in 1.x versions it inconsistently returned null).<br>
|
|
</div>
|
|
<br>
|
|
<hr style="width: 100%; height: 2px;">
|
|
<address><a href="mailto:p.singleton@keele.ac.uk">Paul Singleton</a></address>
|
|
<address>
|
|
drafted Wednesday 4th February 2004<br>
|
|
<br>
|
|
</address>
|
|
</body>
|
|
</html>
|