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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b14a804025dceb20 X-Google-Attributes: gid103376,public From: Marin David Condic Subject: Re: Constructors/Destructors in Ada95 Date: 2000/10/25 Message-ID: <39F6D201.73C006FA@acm.org>#1/1 X-Deja-AN: 685639140 Content-Transfer-Encoding: 7bit References: <39EE160D.F0A2000@bigfoot.com> <39EF5431.BF4CD793@bigfoot.com> <39F0A6C7.E592AFFB@averstar.com> <39F4AE95.4DB04145@bigfoot.com> X-Accept-Language: en X-Server-Date: 25 Oct 2000 12:28:07 GMT Content-Type: text/plain; charset=us-ascii Organization: Quadrus Corporation Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-10-25T12:28:07+00:00 List-Id: Ray Blaak wrote: > I really would like to be able to do: > > procedure ":="(target : in out T; source : in T); > > so as to have complete control over what is happening. I vaguely recall some > rationale from the Ada 9X discussions for why user-defined assignment per se > was not incorporated. Does anyone remember? I don't know about the Ada 9X discussions specifically, but if you think about it, there are a lot of obvious problems with trying to redefine ":=". The biggest problem is that it is not a subprogram - it is a primitive feature of the language. I believe this might be an example of Godel's Theorem. There are some features of the language (any language) that cannot be expressed in the language itself. As a "function" it would require that a) the left parameter be treated as "out" and b) that the function need not return a result. (or that it could be ignored. Does a statement like: "X < Y ;" make sense in Ada?) As a procedure, you'd have to allow procedures to have symbol names - which opens up a whole can of worms. Further, it would mean allowing "infix procedures" which is hard to make sense of - or at least could make programs look really strange. I'm sure there are dozens of other reasons why it was decided not to provide a means of letting the user define assignment. I'd think it would require perverting, warping and twisting language concepts too much. (Look at the semantics of C++ construction/destruction sometime - especially as it applies to function parameters - and see what an abomination that can become! :-) -- ====================================================================== Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/ Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m Visit my web site at: http://www.mcondic.com/ "Giving money and power to Government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke ======================================================================