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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f51e93dacd9c7fca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-02 13:41:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr12.news.prodigy.com.POSTED!not-for-mail From: "Pat Rogers" Newsgroups: comp.lang.ada References: <3d0ce154_5@news.bluewin.ch> <3d0e574d_2@news.bluewin.ch> <3d0fb5e8$1_3@news.bluewin.ch> <_cvS8.63267$UT.4317265@bgtnsc05-news.ops.worldnet.att.net> Subject: Re: status of Ada STL? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <8doU8.1583$mJ4.717187183@newssvr12.news.prodigy.com> NNTP-Posting-Host: 208.191.182.164 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr12.news.prodigy.com 1025642436 ST000 208.191.182.164 (Tue, 02 Jul 2002 16:40:36 EDT) NNTP-Posting-Date: Tue, 02 Jul 2002 16:40:36 EDT Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: OP]QRACE[BWMQ_H]]ZN@_TDAYZOZ@GXOXJXNMRQIMASJETAANVW[AKWZE\]^XQWIGNE_[EBL@^_\^JOCQ^RSNVLGTFTKHTXHHP[NB\_C@\SD@EP_[KCXX__AGDDEKGFNB\ZOKLRNCY_CGG[RHT_UN@C_BSY\G__IJIX_PLSA[CCFAULEY\FL\VLGANTQQ]FN Date: Tue, 02 Jul 2002 20:40:36 GMT Xref: archiver1.google.com comp.lang.ada:26822 Date: 2002-07-02T20:40:36+00:00 List-Id: "Robert A Duff" wrote in message news:wcc4rfhj43l.fsf@shell01.TheWorld.com... > Anyway, the "obvious" solution is to make ":=" a procedure rather than a > function. Unfortunately, this solution doesn't work, which is why we > didn't choose it. The reason is explained in the AARM (I'm too lazy to > look up the reference right now), but it doesn't exactly make Ada look > good. Paul Hilfinger's 1983 PhD dissertation on this very subject was most interesting: Title: Abstraction Mechanisms and Language Design Series Title: ACM Distinguished Dissertations Publisher: MIT Press ISBN: 0-262-08134-2 but good luck finding it. > > You have the same capability in Ada. Yoy get assignment for free and if you > > need to change the behavior, you derive from Controlled and define your own > > Initialize, Adjust and Finalize subprograms. It actually works much cleaner > > than Constructors and Destructors in C++ - especially where parameter > > passing is concerned. The important thing is that you can acomplish the same > > thing in Ada that you can in C++ ... > > Not quite. A serious limitation is that Adjust can't get its hands on > the left-hand side. The issue I ran into was that I wanted a non-limited type for the sake of assignment but I wanted values of the type to have unique "identity", ie, components that did not change during assignment. Because the entire LHS is overwritten with the bit-wise copy, that's not easy to maintain like it is in C++. (This was for an incremental recovery cache, in which assignment only stores the value if necessary.) One approach was to have the identity info in a separate object and hash on the address of the assignable object (and hope the address doesn't change!). Another was to have the identity info referenced via an access discriminant -- since assignment could not actually change the value of the discriminant (other Constraint_Error), the (indirect) identity was maintained. Still, very ugly compared to user-defined operator "=" in C++. When asked, I tell people that when I cannot write in Ada I often choose C++ for this kind of transparent extension, and by the same reasoning see Java as comparatively underpowered. -- Patrick Rogers Consulting and Training in: http://www.classwide.com Real-Time/OO Languages progers@classwide.com Hard Deadline Schedulability Analysis (281)648-3165 Software Fault Tolerance