Re: Sets and Lists, again

From: x <x_at_not-exists.org>
Date: Mon, 22 May 2006 13:32:39 +0300
Message-ID: <e4s3rc$psm$1_at_emma.aioe.org>


"David Cressey" <dcressey_at_verizon.net> wrote in message news:7gkbg.4$J95.2_at_trndny05...
> Recently, in a thread on implementing both threads and lists in a
> programming language, the example of lists or sets of Presidents arose.
I
> mentioned that in a list of presidents, Grover Cleveland would appear
once,
> but in a list of presidencies, he would appear twice.

> Bob Badour asked what purppose would be served by a list of presidents, or
> words to that effect. I'm interested.

We all like teleportation, telepathy, and reversible processes don't we ? How can we live without the UNDO function.

> If one could have a set of presidents, why would one ever want a list?
In
> general, if a language implements sets, why would the same language need
> to also implement lists? What does it buy you?

It's instructive to look at the definitions in a dictionary. Mine shows 89 definitions for set.
I like this one:

     Set (set) also <Seth> n.
                  1.  an ancient Egyptian god, represented with
                       the head of a donkey or other mammal.

The word list has only around 30 such definitions. It say something about strips, to desire, to listen and such. It made me think about the ball notes with the dance order.

> I'm thinking of Lisp, which implemented lists, but not sets. MDL (aka
> Muddle) implemented arrays, and that's one step closer to implementing
sets,
> but not all the way.

To answer the question about what operators are defined on lists, I've heard about those:

- concatenation
- head/tail
- composition if the list is interpreted as a transformation

> SQL implemented sets, but not lists. Although local extensions of SQL do
> implement lists, e.g. "Segmented Strings" in DEC Rdb (aka Oracle/Rdb),
> it's not really part of the language as such.

Operators:
- set operators
- join
Very similar to lists.

> I'm also thinking of Pascal, which implemented sets, (as bitmaps), and
also
> lists, albeit implicitly. What I mean is that you can combine the
concepts
> of "record" and "pointer" in Pascal to construct dynamic linked lists of
> whatevers. But Pascal was primarily for teaching and learning
programming,
> and may have implemented both for precisely that purpose.

> So, if you have sets, why do you need lists?
Just in case.
Men don't like to follow the order in a woman ball notes (a list ?). Received on Mon May 22 2006 - 12:32:39 CEST

Original text of this message