JPL and set_prolog_flag(unknown, fail)

View: New views
2 Messages — Rating Filter:   Alert me  

JPL and set_prolog_flag(unknown, fail)

by Christoph Quix :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have an application which calls Prolog from Java.
After setting the Prolog flag "unknown" to "true"
(unknown predicates fail silently instead of raising exceptions),
JPL throws an exception when I am retrieving results
from Prolog. In particular, there is a NullPointerException
in Compound.quotedName() (called by Compound.toString).

This has probably to do with the autoload feature,
which is implicitly disabled if "unknown" is set to fail.

I am currently using "warning" as value for "unknown",
which works, but I do not want the warning messages.

Regards,
  Christoph

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: JPL and set_prolog_flag(unknown, fail)

by Jan Wielemaker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christoph,

On Wednesday 10 June 2009 01:54:04 pm Christoph Quix wrote:

> Hi,
>
> I have an application which calls Prolog from Java.
> After setting the Prolog flag "unknown" to "true"
> (unknown predicates fail silently instead of raising exceptions),
> JPL throws an exception when I am retrieving results
> from Prolog. In particular, there is a NullPointerException
> in Compound.quotedName() (called by Compound.toString).
>
> This has probably to do with the autoload feature,
> which is implicitly disabled if "unknown" is set to fail.
>
> I am currently using "warning" as value for "unknown",
> which works, but I do not want the warning messages.

Most of SWI-Prolog will not work nicely after setting unknown to fail
globally (it can be ok inside a module). To get rid of the errors, start
here:

http://www.swi-prolog.org/FAQ/UndefinedCode.html

        Cheers --- Jan

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog