Re: against list flattening

Markus Triska <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
"Richard A. O'Keefe" <[email protected]> writes:

> The clincher, of course, is
>
> 	L = [a,B,c], flatten(L, R), B = [2,3]
> =>	R = [a.[2,3],c]
>
> which is not flat.

I would like to endorse this excellent argument. flatten/2 does not
satisfy important declarative properties exactly because variables that
occur in its first argument are implicitly considered to be non-lists,
although declaratively, they stand for lists as well. In many cases,
append/*2*, which has much nicer properties, perfectly suffices.
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.