Re: More on lists and sets

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 27 Mar 2006 19:32:48 -0800
Message-ID: <1143516768.848726.281690_at_g10g2000cwb.googlegroups.com>


vc wrote:
> Marshall Spight wrote:
> > vc wrote:
> > > paul c wrote:
> > >
> > > The usual list intersection opeartion (L = L1 intersect L2) is defined
> > > as
> > >
> > > L = [x | x <- L1, x in L2]
> >
> > You speak as if "list intersection" is a well-defined, well-understood
> > term with no significant disagreement.
>
> It's been so defined and understood starting at least with Lisp as well
> as in languages like Scheme, Haskell and ML.

I asked a Lisp programmer, and he said, no, that's not what means, and provided supporting common lisp documentation to show it having another meaning. I asked an SML programmer and he said it wasn't a term he was familiar with, but he would assume it meant the operation you described. I would have liked to have asked a Haskell programmer, but there are no working Haskell programmers in the USA (kidding) so I had to look it up in "Haskell: The Craft of Functional Programming" instead. No entries under "list intersection" and "intersection, list". So this does not appear to me to be a particularly universal definition. Perhaps I am misunderstanding you. Anyway, what is interesting to me is examining different collection algebras for different properties, rather than investigating what terms are popular or not.

> >This seems to me more like an imperative operator than a
> >functional one
>
> That's a trivial observation. Any declarative statement can be
> interpreted 'imperatively'.

Nonetheless, I find it instructive to consider imperative and functional
operators distinctly. Regardless, on further reflection I have changed my mind about this having an imperative feel to it, and withdraw the objection.

But it's still not commutative. :-)

Marshall Received on Tue Mar 28 2006 - 05:32:48 CEST

Original text of this message