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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Mon, 21 Apr 2014 18:09:46 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> <8bhozh836pyt$.1qctlysud0s2q$.dlg@40tude.net> <1cdsyxjzsfgzm.1synpaujysv21$.dlg@40tude.net> <1aa804jg9qq4o$.wdiq33yo621l.dlg@40tude.net> <1w6eh0aiksmdh$.1h16p7y0b8c6h.dlg@40tude.net> <17twpp4p8u7o$.1idvzaaio4f3t$.dlg@40tude.net> <1wjmcbk375lzk.6o7dpqcp3va3.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1398121787 11400 69.95.181.76 (21 Apr 2014 23:09:47 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 21 Apr 2014 23:09:47 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 5862 Xref: number.nntp.dca.giganews.com comp.lang.ada:185920 Date: 2014-04-21T18:09:46-05:00 List-Id: "Niklas Holsti" wrote in message news:brepivFq9kcU1@mid.individual.net... > On 14-04-19 00:28 , Randy Brukardt wrote: >> "Niklas Holsti" wrote in message >> news:brdegqFi62jU1@mid.individual.net... ... >> One of >> the things that attracted me to Ada in the first place is that it forces >> me >> to specify enough that it prevents many of my worst impulses. > > I learned programming with Algol and did not encounter C until I had > experienced various forms of BASIC, COBOL, and Fortran (plus a few > assembly languages). This shielded me, I think, from being tempted to > use C-style short-cuts. So, perhaps unusually, I don't feel at all > constrained by Ada's requirements on explicitness, careful > specification, and strong typing. Well, I started with various programmable calculator "languages" (really a machine language), then Fortran, then various Basics, then Z80 assembler, then a language survey class, then a class with C language assignments. The only school assignment that I didn't get to work by the due date was in C. I spent several hours after presenting it to the professor trying to figure out why one of the guns wouldn't fire (it was supposed to a game on a vector display, which we had to demonstrate -- I chose something vaguely like Space Invaders, which was new at the time). It proved to be an access beyond the end of an array that corrupted the firing table. I think I've written 7 or 8 lines of C since. :-) [C is now pretty much a read-only language for me, sort of like French.] But for me, I don't the languages used would make that much difference. My Dad is a tinkerer who would rather try for 4 hours to start a malfunctioning chain saw than to just take it to a repair shop and do something else. (That's the story from this past weekend, so some things change little!) I certainly learned that from him, and I *know* I'd dream up insane ways to get the job done if the language didn't impose some sanity. Maybe a little less so than in years past, but probably not enough to actually accomplish anything. ... >> I'd prefer a much simpler declaration of inheritance, something like: >> type Child is new Parent with ... >> with inherits => Foo, Bar, Blech; >> >> where names not listed are hidden from all visibility unless overridden. > > This form would probably strongly discourage overloaded operation names. Possible, although in many instances, all of the overloaded routines do essentially the same thing and thus either all need overriding or none do. (After all, if you have overloaded routines doing *different* things, something is wrong!) >> Whether that's enough or if some alternative with optional profiles is >> necessary, I don't know. Most operations aren't overloaded, after all, so >> the profile is just noise. > > I have quite a few overloaded primitive operations, perhaps because I > tend to use named association in all calls so that the parameter names > extend and clarify the brief operation name. Yes, that works. But still, you probably don't have too many Open operations that close objects. :-) As I said, I've found that it's common that you need to override all of the Open operations (because they all need to set a new component, for instance, or call a different Open routine that does that), or the original versions are all good enough. Perhaps that's different if multiple inheritance gets involved, but it certainly seems true for single inheritance. But I don't claim to know the best way to do this, and it's pretty irrelevant for Ada anyway (it would be way too incompatible to require for derivations unless a new kind of derivation was involved - and it would take some imagination to figure a reason for needed a new kind of derivation). Randy.