Re: SWI-Prolog : current_prolog_flag(unknown, fail) is failing.



On 2006-08-30, robert.oschler@xxxxxxxxx <robert.oschler@xxxxxxxxx> wrote:
Hello,

I'm trying to set the "unknown" prolog flag to "fail". "fail" is
listed as a valid value in the reference manaul. The call fails. What
am I doing wrong?

It helps a lot if you say what you are doing in the first place.

1 ?- set_prolog_flag(unknown, fail).

Yes
2 ?- call(foobar).

No.

Note:

?- foobar.
ERROR: Undefined procedure: foobar/0

This is the DWIM (Do What I Mean) correction system of the toplevel that
still complains. Whats the point calling something from the toplevel that
doesn't exist?

--- Jan

P.s. Don't change this flag. Its a bit nuisance and it should never
have existed in the first place. In SWI-Prolog in particular as
most of the environment relies on autoloading and you cannot do
that if calling an undefined is not an error. See the dynamic
directive.

If you really have to, for example to test a possible incomplete
program as a logical theory, change the flag in the context of
a module and load the theory into that module.
.



Relevant Pages

  • Re: ExitWindowsEx function not working.
    ... you should always check the API return value ... to determine if the API calling fails. ... As Int32, ByVal dwreserved As Int32) As Int32 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: set of sets
    ... the add succeeds ... the remove fails eventually not calling hash. ... Is this fast as with lists? ...
    (comp.lang.python)
  • Re: 802.1x for wired networks
    ... via 802.1x to a wired network? ... calling 80211 ioctl's and thus fails. ... I found the open1x project, but did not find it in the ports tree. ...
    (freebsd-net)
  • Re: acmStreamOpen
    ... > I'm calling this funcktion with the following params and it always fails ...
    (microsoft.public.win32.programmer.mmedia)