Re: Ann: SWI-Prolog 6.5.3

Michael Hendricks <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAFHuXubPGk6tJVTFTZkhiytKZ=qgEmfWWd8zdpBUVP-X2XE+PA@mail.gmail.com>
On Wed, Nov 20, 2013 at 8:05 PM, Richard A. O'Keefe <[email protected]>wrote:

>
> On 20/11/2013, at 10:43 PM, Jan Wielemaker wrote:
> [about the new behaviour of memberchk/2]
> > Even if
> > possible, I still do not like that, as it will imply that strings may
> > silently be transformed into code lists.
>
> Now I am puzzled and confused.  The point of the NU Prolog approach
> was that strings *were* lists, it's just that some strings were stored
> more compactly than others.  It meant, for example, that you could have
> large amounts of text data in static code.
>
> ...
>
> In the same way, in the NU Prolog approach, a byte-per-element string
> *IS* a code list, just stored differently.
>

I think this is an important point worth extra attention.  In one sense,
[H|T] is just a comfortable interface for sequences of data.  A linked list
is the traditional sequence, but string-stored-as-byte-array is a sequence
too.  A sequence might be the key-value pairs in a map or the bytes in a
stream, etc.  Clojure sequences take the idea to its conclusion by
abstracting the cons interface so that many data structures can implement
it.

I'd love to see this idea in more Prologs.

-- 
Michael
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.