Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.prolog > #14818

Prolog Veterans know the Solution: ADTs (Was: String lists can be a nightmare [WebPL])

From Mild Shock <janburse@fastmail.fm>
Newsgroups comp.lang.prolog
Subject Prolog Veterans know the Solution: ADTs (Was: String lists can be a nightmare [WebPL])
Date 2025-09-05 18:02 +0100
Message-ID <109f53o$15t44$1@solani.org> (permalink)
References <109f4qk$15ss3$1@solani.org>

Show all headers | View raw


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

Back to comp.lang.prolog | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

String lists can be a nightmare [WebPL] Mild Shock <janburse@fastmail.fm> - 2025-09-05 17:57 +0100
  Prolog Veterans know the Solution: ADTs (Was: String lists can be a nightmare [WebPL]) Mild Shock <janburse@fastmail.fm> - 2025-09-05 18:02 +0100

csiph-web