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,4961da398a273222 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-10 21:34:10 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!gatech!udel!news.mathworks.com!uunet!in1.uu.net!telesoft!kst From: kst@thomsoft.com (Keith Thompson) Subject: Re: Ada self-referential operators Message-ID: Originator: kst@pulsar Sender: news@thomsoft.com (USENET News Admin @flash) Organization: Thomson Software Products, San Diego, CA, USA References: <3hg6gj$mkt@miranda.gmrc.gecm.com> Date: Sat, 11 Feb 1995 05:34:10 GMT Date: 1995-02-11T05:34:10+00:00 List-Id: In <3hg6gj$mkt@miranda.gmrc.gecm.com> bill@valiant (R.A.L Williams) writes: [...] > Obviously, any compiler which tried to optimise a basic block containing > that would be in for a nasty surprise! So, OK, we disable statement level > optimisation where overloaded assignment is used. Caveat emptor (I don't > know the latin for programmer) -- if you use this construct, don't expect > optimisation. Optimization isn't really an issue. Optimizers typically operate on some intermediate form (or sometimes on machine code). A call to a user-defined operator (assignment or otherwise) would appear to the optimizer as an ordinary subprogram call, which it could optimize or not just as if it were written explicitly using call notation. If the optimizer has access to the body of the subprogram (e.g., if it's declared inline), it may be able to do something with it. As for user-defined assignment, (as in procedure ":="(Target: in out Some_Type; Source: in Some_Other_Type); ) I'd love to see it in the language myself, but defining it really is more complicated than it looks. I don't claim to understand all the issues, so I'll leave it to others to address them. -- Keith Thompson (The_Other_Keith) kst@thomsoft.com (kst@alsys.com still works) TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718 When you're a nail, every problem looks like a hammer.