comp.lang.ada
 help / color / mirror / Atom feed
* list strawman
@ 2002-01-06 20:55 Stephen Leake
  2002-01-07 15:56 ` Ted Dennison
                   ` (2 more replies)
  0 siblings, 3 replies; 64+ messages in thread
From: Stephen Leake @ 2002-01-06 20:55 UTC (permalink / raw)


I've done a priliminary implementation of
http://www.telepath.com/dennison/Ted/Containers-Lists-Unbounded.ads.html
using SAL lists as the base. It implements fully
safe iterators. The sorting nested package is not implemented, mostly
because I didn't have time, but also because there are some design
issues (I'll talk about that in a separate post).

See http://users.erols.com/leakstan/Stephe/Ada/strawman-sal.html to
Download my the source. It relies on a slightly modified version of
SAL (two added functions); if you want to actually compile it, either
add the functions yourself (should be obvious), or send me an email.

There is only a simple test; it demonstrates the operation of "&".
But it uses an iterator to print the lists, so it's actually a good
test. I'll try to use Ted's test harness when that is ready.

This was an interesting excersize. I got quite stuck on making the
iterators safe, while at the same time not requiring the user to use
'Unchecked_Access. A hint from http://homepage.ntlworld.com/ramatthews/
(Robert A. Matthews' GAPSE) set me straight; use a layer of indirection.

There are three source directories: Iterator_1, Iterator_2, and
Source. The Iterator directories show early attempts at implementing
safe iterators; the file "iterator_design.text" describes the attempts
and the final result.

The final implementation is quite complex (and I haven't done sort
yet). I don't think I will ever use this package in a real project.
Just writing all the tests to prove that iterators actually are safe
will take quite a while. But it is an interesting example of what can
be done.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 64+ messages in thread
* Re: Overridability of _private_ predefined "="  [was Re: list strawman]
@ 2002-01-18 10:43 Christoph Grein
  0 siblings, 0 replies; 64+ messages in thread
From: Christoph Grein @ 2002-01-18 10:43 UTC (permalink / raw)


Please, before going into further discussions about reemergence of predefined 
operations and thinking about changing the language, read the corresponding 
chapters in the AARM (the Annotated Ada Reference Manual), e.g. AARM 
4.5.2(24a-c).

With respect to "block compare", this is not possible for tagged types, floating 
point types if there are signed zeros, and who knows for which other cases.

Thus it is generally a bad idea to override predefined operators for non-tagged 
types. If this is really necessary, then utmost care has to be applied 
everywhere such a type is used (e.g. as components of an array).

Reemergence has been introduced in the first place to avoid incompatibilities 
with Ada83.

Christoph Grein

> Its even worse than just that.  Now a "block compare" of any composite
> type
> that has a nontagged private type as a componant is questional because
> that
> comparison will utilize the predefined "=" of the private type even
> though
> the creator of the private type may have seen it proper to overridden
> it.
> 
> There was a thread, gosh, I guess less than two years ago where I was
> trying to
> argue that this was a disaster wrt generics and that reemergence of "="
> seemed
> to be a special case wrt the whole reemergence issue.   I now feel that
> the
> situation is very bad in general as opposed to being bad only wrt
> generics.
> 
> Does anyone think that it would be good for there to be a change in the
> language such that for private types, if a primative "=" returning
> boolean exists then it
> should be the "=" used as part of block compares and that the predefined
> one
> should not reemerge in generics?  This would not have been incompatible
> with
> Ada83, right?
> 
> I hope that the above is not perceved as rehashing old arguments - I do
> not
> remember the issues having been discussed exactly as above.
> 
> Vincent Marciante




^ permalink raw reply	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2002-02-18  8:57 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-06 20:55 list strawman Stephen Leake
2002-01-07 15:56 ` Ted Dennison
2002-01-07 15:57   ` Ted Dennison
2002-01-07 16:33   ` Stephen Leake
2002-01-07 16:37     ` Stephen Leake
2002-01-07 19:31       ` Ted Dennison
2002-01-07 19:26     ` Ted Dennison
2002-01-07 22:05       ` Stephen Leake
2002-01-07 22:51         ` Ted Dennison
2002-01-08  0:48           ` Steven Deller
2002-01-08 15:32             ` Ted Dennison
2002-01-08 15:43               ` Jean-Marc Bourguet
2002-01-08 17:07                 ` Ted Dennison
2002-01-08 17:21                   ` Jean-Marc Bourguet
2002-01-08 19:12                     ` Ted Dennison
2002-01-09  8:09                       ` Jean-Marc Bourguet
2002-01-09 18:37                         ` Ted Dennison
2002-01-11  9:37                           ` Jean-Marc Bourguet
2002-01-11 17:03                             ` Ted Dennison
2002-01-11 17:47                               ` Jeffrey Carter
2002-01-12 15:10                               ` Jean-Marc Bourguet
2002-01-13 10:18                                 ` Jean-Marc Bourguet
2002-01-14 16:02                                 ` Ted Dennison
2002-01-14 16:22                                   ` Jean-Marc Bourguet
2002-01-08 19:57                     ` Steven Deller
2002-01-08 19:54                 ` Steven Deller
2002-01-08 19:54               ` Steven Deller
2002-01-08 20:46                 ` Ted Dennison
2002-01-08 21:21                   ` Stephen Leake
2002-01-08 21:49                     ` Ted Dennison
2002-01-09  9:21                       ` Thomas Wolf
2002-01-09 15:20                         ` Ted Dennison
2002-01-09 15:53                           ` Stephen Leake
2002-01-09 21:21                             ` Ted Dennison
2002-01-09 17:42                         ` Mark Lundquist
2002-01-09 21:02                           ` Jeffrey Carter
2002-01-10  8:47                             ` Thomas Wolf
2002-01-11 17:38                               ` Jeffrey Carter
2002-01-11 21:52                                 ` Chad Robert Meiners
2002-01-12  5:45                                   ` Jeffrey Carter
2002-01-12 22:20                                     ` Chad R. Meiners
2002-01-13 17:03                                       ` Jeffrey Carter
2002-01-13 23:47                                         ` Chad R. Meiners
2002-01-14  1:32                                           ` Ted Dennison
2002-01-14  5:12                                           ` Jeffrey Carter
2002-01-14  5:12                                           ` Jeffrey Carter
2002-01-10 14:39                           ` Ted Dennison
2002-01-11  5:34                             ` Mark Biggar
2002-01-12 12:20                               ` Simon Wright
2002-01-14 14:53                                 ` Matthew Heaney
2002-01-16  5:56                                   ` Simon Wright
2002-01-18  9:15                           ` Overridability of _private_ predefined "=" [was Re: list strawman] Vincent Marciante
2002-01-19 16:58                             ` Vincent Marciante
2002-01-19 22:42                               ` Nick Roberts
2002-01-09  3:10                     ` list strawman Ted Dennison
2002-01-09 19:09                       ` Ted Dennison
2002-01-08 21:26               ` Georg Bauhaus
2002-01-08 22:13                 ` Ted Dennison
2002-01-09 20:52               ` Jeffrey Carter
2002-02-17 15:04 ` Florian Weimer
2002-02-17 15:05 ` Florian Weimer
2002-02-18  1:43   ` Stephen Leake
2002-02-18  8:57     ` Florian Weimer
  -- strict thread matches above, loose matches on Subject: below --
2002-01-18 10:43 Overridability of _private_ predefined "=" [was Re: list strawman] Christoph Grein

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