Closed jnidzwetzki closed 1 year ago
I see. This is because the autoloader reads the library module header using operators from user
. It works by switching off autoloading (but that requires importing everything explicitly). I have pushed SWI-Prolog/swipl-devel@8a47fcb876e5593492c2906ae2f530d274f30492 to use the system operator table.
It is not likely there will be another 8.4.x release, so you can either apply this patch on 8.4 or use 8.5 (or one of the other work-arounds).
Hello @JanWielemaker,
Thank you so much for your quick reply, the patch, and the explanation. I added a set_prolog_flag(autoload, user).
call to our Prolog code; this also solves the problem. Our code now runs on the existing 8.x versions of SWI-Prolog.
Thanks again for your help Jan
Hello,
For several years, we have been using SWI-Prolog in the query optimizer of our database. At the moment, SWI-Prolog 7.6 is used in the project, but we are trying to migrate to a newer version. However, I have observed one issue with the new SWI-Prolog version, and I want to ask if this issue is known and if there are any known solutions or ideas on how to address the problem.
SWI-Prolog highlights matching brackets by moving the cursor to the opening bracket for a short time when a closing bracket is entered. This works fine after
swipl
7 or 8 are started. After our code is loaded, the functionality works inswipl
7. Inswipl
8 the error messageERROR: /usr/lib/swi-prolog/library/lists.pl:48:16: Syntax error: Operator expected [...]
(see the test code below for the full error message) is shown when the closing bracket is entered.Since we are processing SQL with our Prolog program, operators such as
delete
are defined (e.g.,op(993, fx, delete)
). So far, this has not caused any problems. In SWI-Prolog 8.x, we seem to face a name conflict with this definition. I have created a simple program that demonstrates the change in Prolog's behavior.A workaround is to start
swipl
with the option--tty=false
, but this also disables the history.Simple Test Code
SWI-Prolog 7.x
SWI-Prolog 8.x
Line 48 of
/usr/lib/swi-prolog/library/lists.pl
isIs there any way to run the code with SWI-Prolog 8.x without making major changes (e.g., introducing namespaces)?
Best Regards Jan