Changes in SWI since 2009

I’m trying to revive the Prolog code here:

At times I feel more like I’m exhuming it than reviving it. Among other problems, it appears that name/2, deprecated but still supported, is not longer as forgiving. Apparently at one time, SWI Prolog name/2 could manage this

name([["./lang_bin/", 101, 110, 103 | “-”], 101 | “”], Filename)

doing all the list flattening, numeric ASCII code conversion and string-handling without breaking a sweat. Now it just wants a list of characters. I’ve substituted a wrapper, xName/2, to perform the predigestion name/2 apparently used to do. It can handle some cases already, but I’m not done yet. It doesn’t help that my skills with Prolog (never stellar) are now very rusty.

I suspect this isn’t the only change in SWI Prolog I’ll need to accommodate in order to get NSM DALIA up to date. Is there a list of what’s changed over the last decade?


Did you try setting the double_quotes flag to codes at the beginning of the file containing that call?

:- set_prolog_flag(double_quotes, codes).

The default value of this flag changed, IIRC, from codes to string.

Finally getting back to this … Putting set_prolog_flag/2 at the beginning of the file(s) yielded a lot of very confusing error messages. Then I noticed that “module/2” needs to be first, and I added the set_prolog_flag/2 call just after any module/2 calls. This got me out of SWI-Prolog 6.6.6 and to 7.2.0. It’s perhaps unsatisfying as a permanent fix, of course. I agree with the reasoning here:

But this was helpful. Thank you.

This might be of use. It is not specific to your problem, but might give you some insight into how to work with strings since 2009.