From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,86a457a80a9f4412 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!news.highwinds-media.com!xara.net!gxn.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Generic Collection Date: Sun, 13 May 2007 12:00:58 +0100 Organization: Pushface Message-ID: References: <1178652593.006083.173150@l77g2000hsb.googlegroups.com> <1178658022.9164.17.camel@kartoffel> <1178661586.585164.191690@e51g2000hsg.googlegroups.com> <1178722277.733981.6200@l77g2000hsb.googlegroups.com> <1178727131.9164.38.camel@kartoffel> <1178736886.994385.37140@y80g2000hsf.googlegroups.com> <1178837285.391940.192010@e65g2000hsc.googlegroups.com> <17ls9n89vi0vh.n8gfdmvo4lv2$.dlg@40tude.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1179054058 7251 62.49.19.209 (13 May 2007 11:00:58 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 13 May 2007 11:00:58 +0000 (UTC) Cancel-Lock: sha1:98yhaj0egGX6o8vtETY/AjOtj1Q= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (darwin) Xref: g2news1.google.com comp.lang.ada:15789 Date: 2007-05-13T12:00:58+01:00 List-Id: "Dmitry A. Kazakov" writes: >> I would probably end up with a package for each, with appropriate Add >> operations. >> >> with Tuples; >> package Tables is >> type Table is private; >> procedure Add (To : in out Table; Item : Tuples.Tuple); > > + some other set-theoretic operations on the containers. > > You meant > > procedure Add (To : in out Table; Item : Tuples.Tuple'Class); > > of course. Did I? Not if Tuple isn't (visibly) tagged. Why would I make it tagged? (I don't see anything in the application use cases so far (!) to say it should be). If your implementation guidelines say that everything should be tagged I'd have to ask why? (I don't believe that programming-language inheritance is necessarily a good way of implementing application area specialization/generalization). >> I can't see what possible advantage you'd get from being able to >> add a Colour to a Schema! If you make a container that can contain >> anything you will need to have runtime checks to enforce this sort >> of rule rather than compile-time checks. > > The problem is not in checks but with the design. The code reader > has no idea of what can be done with a collection member <=> what to > expect there <=> what can be put there. The algebra of collections > does not tell anything about that (= about the meanings of tuples > and the sets of). It is not yet a design. I think we are probably agreeing here. In general collections/containers are part of the implementation, not part of the application; I don't think I've ever found a case where it would have been right to show an application-level concept like Table as being visibly a container. >> Elsewhere in this thread you seemed >> to scoff at this as being a concern; I think classwide programming >> ought to be restricted to the places where it brings you an advantage >> rather than being something that makes your life difficult. > > Uhm, class-wide programming above is rather about implementation of > containers in a manner independent on what is in. This does not > contradict in any way to problem solving, which presumes doing > something with the things in the containers. These are just two > different problems. So as long as nobody says anything about what > should be done with tuples, we assume that it must be nothing. (:-)) I guess I expressed myself badly there. I was trying to make the point I've just made above.