comp.lang.ada
 help / color / mirror / Atom feed
From: Markus E Leypold <development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de>
Subject: Re: Generic Package
Date: Fri, 04 May 2007 02:15:53 +0200
Date: 2007-05-04T02:15:53+02:00	[thread overview]
Message-ID: <miejlxo346.fsf@hod.lan.m-e-leypold.de> (raw)
In-Reply-To: f1dqcc$f1v$1@jacob-sparre.dk


"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Markus E Leypold"
> <development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de> wrote in
> message news:ijwszq2tiq.fsf@hod.lan.m-e-leypold.de...
> ...
>> > I actually agree with DK, using his definitions. The problem is that no
> such
>> > set could ever be constructed (even on a piece of paper, the elements
> have
>> > an order). So the fact is completely irrelevant: there is no such thing
> as
>> > an unordered set.
>>
>> I repeat: There is a bit of confusion on 3 different things:
>>
>>  (a) the way we write down sets (notation)
>>  (b) orders (binary relations with certain properties)
>>  (c) orderable sets, i.e. sets for which an order can be defined.
>
> Probably. But I was *very* clear, I was using DK's definitions. Whether they
> match some mathematical definition I don't know. You're arguing from some
> abstract mathematical definition and assuming everyone agrees with it. 

No really. Calling something an ordered set because one can write down
the elements in some order "doesn't wash" IMO.

> That doesn't wash. (Your definition is consistent, and fine, its
> just different than the one I was using. Thus it is hard to not talk
> past each other.)

Quite. Actually I proposed 2 definitions, one mathematical, the other,
very similar, like what "usually" is used as an ordered container in
programming (or in textbooks about abstract data types). I put
"usually" in '"' because I see that people probably have different
experiences. Every other definition (especially those that don't start
with "A ... is a thingy with ..." I still see with distrust.

> ...
> ...
>> > Of course you can if you assume primitives that effectively give you an
>> > order.
>>
>> No. Have you read the functional spec I wrote? I just use set
>> operations and a suitable cursor abstraction. Of course the choice of
>> the next element is not deterministic in the specification but that is
>> as it should be: It indicates that the implementation has a certain
>> degree of freedom here.

> I didn't recall it, but I think it actually proves my point. You've just
> moved the magic into a "cursor" abstraction and a "Next" abstraction - which
> shows far more implementation than the "foreach" iterator abstraction I was
> thinking of. 

One can define a foreach operator which applies a given operation to
each element in quite a similar way. I did it with a cursor, because
(a) that would be the way iteration would be implemented in an
imperative language and (b) the discussion started out with
iteration. My cursor abstraction doesn't show much implementation
(actually it cannot be implemented very efficiently in this form
because it has to "freeze" the set state state into the cursor when it
is created with first) -- what I wrote just describes what a cursor
does, specifically, selecting the "next element", without recurring to
some kind of order defined on the set or some kind of internal
adresses. And that is the point I wanted to make: a specific order of
the elements might emerge during iteration, but one doesn't need an
order to define (the contract of) an iteration on a set without any
structure (addresses, order) otherwise.

> (There's no good reason for a set to have a cursor abstraction,
> after all.) 

There is a good reason: if you want to iterate over the elements in a
loop, the cursor takes the role of the loop variable, i.e. catches the
state of the iteration (or call that iterator if you like). Foreach
(as I understand you) would be more like a composition operator or a
second order function: It would take a operation and a set and create
an operation from them which is effectively the application of the
operation to every element of the set. Since there are no second order
functions in Ada, that would have to be implemented with a generic
function and using a downward closure or some trick like this.

Whatever -- therefore my preference to express the same thing with an
iterator/cursor. It seemed more natural for a procedural language like
Ada.

> And "Next" gives you an order, even if that order is undefined.

I get an undefined order? :-/ So I'll give you some money, even if it
is not existent. :-)

I think we would have to discuss about the meaning of order, to get to
the ground of this, but better not here :-) and better not now: After
all I never had problems with iterating over sets before, so why
should I suddenly acquire the need to discuss them -- and I gather you
have better things to do, too.

> ...
>> > And I would hope that I was done reading this bulls***, but I'm sure I'm
>> > not...
>>
>> Sorry. I'll stop. No sense in annoying people. But I'm a bit pained
>> that you characterize my "contribution" as BS, whereas you tolerate
>> DKs prevarications pretty well. Never mind.
>
> Sorry, my comment was uncalled for. And it wasn't really directed at you but
> more at everyone who's kept this thread going for what seems like months.
> (And I'm guilty of that, too. I probably ought to get a newsreader with
> thread kill...)

I've now given, what I hope is the last contribution coming from me in
this thread, only because I think that this is one of the rare
opportunities to make my point understood and because I argue it is
related to c.l.a. (i.e. I'm talking about specfying an abstract data
structure formally).

I admit, I'm guilty, too: My conflict is with DK, not with you -- and
there is no sense in leading a proxy war.

Thanks for the opportunity to get my arguments straight once before I
stop and a good day to you :-).

Regards -- Markus




  reply	other threads:[~2007-05-04  0:15 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-25 22:15 Generic Package andrew.carroll
2007-04-26  0:07 ` Jeffrey R. Carter
2007-04-26  7:46   ` Markus E Leypold
2007-04-26  6:02 ` Martin Krischik
2007-04-26  7:57 ` Dmitry A. Kazakov
2007-04-26 15:31 ` andrew.carroll
2007-04-26 16:07   ` Georg Bauhaus
2007-04-26 19:40     ` andrew.carroll
2007-04-26 20:01       ` Georg Bauhaus
2007-04-26 18:54   ` Dmitry A. Kazakov
2007-04-26 21:52     ` Simon Wright
2007-04-27  9:00       ` Dmitry A. Kazakov
2007-04-27 11:11         ` Georg Bauhaus
2007-04-27 12:06           ` Dmitry A. Kazakov
2007-04-27 12:52             ` Markus E Leypold
2007-04-27 14:10             ` Georg Bauhaus
2007-04-27 14:16               ` Dmitry A. Kazakov
2007-04-27 21:44                 ` Georg Bauhaus
2007-04-28  7:38                   ` Dmitry A. Kazakov
2007-04-28 17:50                     ` Simon Wright
2007-04-28 21:04                     ` Ray Blaak
2007-04-29 16:33                       ` Markus E Leypold
2007-04-27 19:44             ` Simon Wright
2007-04-27 20:34               ` Dmitry A. Kazakov
2007-04-27 21:16                 ` Simon Wright
2007-04-28  7:36                   ` Dmitry A. Kazakov
2007-04-27 11:43         ` Markus E Leypold
2007-04-28 17:35           ` Dmitry A. Kazakov
2007-04-28 23:06             ` Georg Bauhaus
2007-04-29  8:19               ` Dmitry A. Kazakov
2007-04-29 15:10                 ` (see below)
2007-04-29 17:48                   ` Dmitry A. Kazakov
2007-04-29 22:36                     ` (see below)
2007-04-30  6:58                       ` Dmitry A. Kazakov
2007-04-30  9:59                         ` Markus E Leypold
2007-04-30 10:01                         ` Markus E Leypold
2007-04-30 10:36                         ` Georg Bauhaus
2007-04-30 10:40                           ` Georg Bauhaus
2007-04-30 12:14                           ` Dmitry A. Kazakov
2007-04-30 14:57                         ` (see below)
2007-04-30 10:30                 ` Georg Bauhaus
2007-04-30 12:16                   ` Dmitry A. Kazakov
2007-04-30 14:48                     ` Georg Bauhaus
2007-04-30 16:29                       ` Dmitry A. Kazakov
2007-04-30 17:24                         ` Georg Bauhaus
2007-04-30 18:54                           ` Dmitry A. Kazakov
2007-04-30 19:29                         ` Simon Wright
2007-04-30 20:04                           ` Dmitry A. Kazakov
2007-05-01  0:11                             ` Markus E Leypold
2007-05-01  9:02                             ` Georg Bauhaus
2007-05-01 10:19                               ` Dmitry A. Kazakov
2007-05-01 13:42                                 ` Georg Bauhaus
2007-05-01 17:16                                   ` Dmitry A. Kazakov
2007-05-01 19:14                                     ` Randy Brukardt
2007-05-01 20:14                                       ` Dmitry A. Kazakov
2007-05-02  7:52                                         ` Markus E Leypold
2007-05-02  8:06                                       ` Markus E Leypold
2007-05-03  0:37                                         ` Randy Brukardt
2007-05-03  8:36                                           ` Markus E Leypold
2007-05-03 23:16                                             ` Randy Brukardt
2007-05-04  0:15                                               ` Markus E Leypold [this message]
2007-05-01 21:41                                     ` Georg Bauhaus
2007-05-02  6:57                                       ` Ray Blaak
2007-05-02  8:22                                         ` Markus E Leypold
2007-05-02  8:07                                       ` Markus E Leypold
2007-05-02 10:29                                       ` Dmitry A. Kazakov
2007-05-02 11:48                                         ` Georg Bauhaus
2007-05-02 11:50                                           ` Georg Bauhaus
2007-05-02 13:12                                           ` Dmitry A. Kazakov
2007-05-02 14:21                                             ` Markus E Leypold
2007-05-03 18:27                                             ` Georg Bauhaus
2007-05-03 19:07                                               ` Dmitry A. Kazakov
2007-05-03 19:49                                                 ` Markus E Leypold
2007-04-29 16:26             ` Markus E Leypold
2007-04-26 21:50   ` Simon Wright
2007-04-27  4:45   ` Jeffrey R. Carter
2007-04-27  7:45     ` Martin Krischik
2007-04-27 22:54       ` Georg Bauhaus
2007-04-30 20:13         ` Matthew Heaney
2007-04-26 20:48 ` andrew.carroll
  -- strict thread matches above, loose matches on Subject: below --
2003-12-02 23:15 Mr. J.
2003-12-03  9:31 ` Dmitry A. Kazakov
2003-12-02 23:13 generic package Ratson Janiv
2003-12-03 17:39 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox