Re:Scryer Prolog
by tannhaeuser on Saturday February 04, 2023 @11:51AM
(#34655840)
> append/3 is only available if library(lists) is loaded
But it isn't loaded in the example Prolog showcase; that was my point ;)
Now, if it's being loaded via use_module (ie using flawed ISO/IEC 13211-2 modules that shall be forgotten since portability isn't achieved), then it would be at odds with the Prologue for Prolog which assumes it's being imported via ISO-conformant ensure_loaded, rather than as a module.
https://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue
Strings are a good representation for ephemeral data, where allocating an atom would yield additional overhead, via an entry in the atom table that is not needed elsewhere and can only be reclaimed by GC instead of much faster on backtracking.
Another major attraction of strings is that we can use DCGs to reason about them, and we can write this specific example equivalently as:
DCGs are another example of a conforming extension, and they are themselves currently being drafted for inclusion in the Prolog ISO standard. In Scryer Prolog, DCGs are available only when library(dcgs) is loaded, so that its default mode after invocation remains strictly conforming.