logoalt Hacker News

tannhaeusertoday at 9:03 AM0 repliesview on HN

> No standardized strings

> ISO "strings" are just atoms or lists of single-character atoms (or lists of integer character codes) [...]. Code written with strings in SWI-Prolog will not work in [other] Prolog.

That's because SWI isn't following ISO (and even moving away from ISO in other places eg. [1]).

ISO Prolog strings are lists of character codes period. It's just that there are convenient string manipulation-like predicates operating on atom names such as sub_atom, atom_concat, atom_length, etc ([2]). You'd use atom_codes to converse between atoms/strings or use appropriate list predicates.

[1]: https://www.reddit.com/r/prolog/comments/1089peh/can_someone...

[2]: https://quantumprolog.sgml.net/docs/libreference.html#string...