• String lists can be a nightmare [WebPL]

    From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Fri Sep 5 17:57:52 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    Maybe its not clear to the Prolog community
    what Problems string lists can create, and what
    potential solutions exists. This complete

    unawareness, leads to funny results:

    ?- test(X), X = [A|_].
    X: abc, A: _13 (3.6ms)

    ?- test(X), X == [a,b,c].
    No results

    So what is going on? Any clues?

    Basically entering the rabit hole that Atom
    type CharList requires all code places that use
    CONS Cells to have scrutinized and possibly changed .

    A rabit hole that lets Scryer Prolog already
    suffer as Markus Triska has expressed.

    Bye
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Fri Sep 5 18:02:44 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    Some Prolog Veterans might know the Solution:
    ADTs . At least I have have myself already
    experimented with string lists 30 years ago,

    and the quickest prototype used Abstract
    Data Types (ADTs). But usually a Prolog system
    cannot apply them so easily, since the CONS Cells

    are usually not ADTs itself already. Also these
    ADTs would not necessarely use heap marking,
    the more easier solution is to let them use a

    garbage collecting heap, something that Heap/Stack
    Prolog systems might have, but I am not sure
    whether WebPL has such a heap.

    Bye

    Mild Shock schrieb:
    Hi,

    Maybe its not clear to the Prolog community
    what Problems string lists can create, and what
    potential solutions exists. This complete

    unawareness, leads to funny results:

    ?- test(X), X = [A|_].
    X: abc, A: _13 (3.6ms)

    ?- test(X), X == [a,b,c].
    No results

    So what is going on? Any clues?

    Basically entering the rabit hole that Atom
    type CharList requires all code places that use
    CONS Cells to have scrutinized and possibly changed .

    A rabit hole that lets Scryer Prolog already
    suffer as Markus Triska has expressed.

    Bye

    --- Synchronet 3.21a-Linux NewsLink 1.2