Closed cbarrick closed 7 years ago
Hi @cbarrick , I cannot reproduce this. The following is what I get:
?- set_prolog_flag(unknown, fail).
Warning: Using a non-error value for unknown in the global module
Warning: causes most of the development environment to stop working.
Warning: Please use :- dynamic or limit usage of unknown to a module.
Warning: See http://www.swi-prolog.org/howto/database.html
?- debug.
false.
IOW, I never get the chance to reproduce your issues with nth1/3
. Are you using other means to set the unknown
flag? I see no call to set_prolog_flag/2
in your example.
I guess I can close this. I can't seem to reproduce it.
When I originally reported this, I was trying to use dicts in a portable way. My approach was to use set_prolog_flag(unknown, fail)
in my module so that dict predicates would silently fail on systems where they weren't available. While debugging that module, I discovered this issue where nth1/3
would fail when it shouldn't.
In my module, the issue occurred when I set_prolog_flag(unknown, fail)
. But I could also reproduce the issue from the REPL by enabling debug mode. So the minimum example I gave above was eaxactly what I was doing. I don't use any config scripts, and I wasn't setting the unknown
flag at the REPL.
I just tried, and I can no longer reproduce this. I have since upgraded my OS and compiler, so maybe that has something to do with it. I build SWI for macOS using homebrew, and the only changes they've made to the build script since my original report were tracking the dev releases and forcing a rebuild when they upgraded readline
.
I'm closing this and chalking it up to an incompatible/buggy dependency in the build.
@cbarrick Thanks for confirming that this no longer reproduces.
BTW, if you're interested in portability then you can try to load SWI with command-line flag --traditional
. See the documentation) for more info.
EDIT updated with minimal example
When the
unknown
flag is set tofail
,nth1/3
does not work. If it is traced, that query will fail, but subsequent queries will succeed.Here is the behavior I am seeing:
I can confirm this bug on V7.2.3, V7.3.21, and 3750df9817c79b7f45af6f146104542d486bb8ac.