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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,baa6871d466e5af9 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Redefinition of "=", elaboration and learning Ada Date: 1997/04/29 Message-ID: <3365E879.567F@elca-matrix.ch>#1/1 X-Deja-AN: 238157493 References: <528878564wnr@diphi.demon.co.uk> <336089AF.6046@elca-matrix.ch> Organization: ELCA Matrix SA Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1997-04-29T00:00:00+00:00 List-Id: Another reason why I think we should have automatic elaboration order calculation that works in the simple cases, and no reemergence of predefined operations once they have been redefined, is that the majority of Ada programmers do not understand these problems because they have never studied the language to that level of detail (which is perfectly OK, one should not be required to read the entire RM three times to be able to write a piece of software in Ada). Having to use pragma Elaborate_All when instantiating a generic at the libarary level is, IMO, counterintuitive and unnecessarilly complicated. Having predefined "=" reemerge in strange places when it's been redefined is also counterintuitive, and the text in chapter 12 of the RM won't help you much if you are not a language lawyer or compiler writer. And then try explaining to a novice programmer, without making him believe that the language definition is flawed, that if he makes his type tagged then everything will work fine :-) What the user sees when he discovers packages and private types is that he can define abstractions that he can use without knowing how they are implemented. What he sees when he discovers a library of generic components is that he can instantiate them and then use them. In both cases, he hits what is IMO a severe pitfall: reemergence breaks his abstraction, and he (potentially) gets Program_Error when he instantiates his generic. For me, these are not really severe problems (except that I don't like the way they were handled in Ada 95) because I know how to fix them. But how is a beginner going to find his way to tagged types or elaboration pragmas ? Not very easily I think, unless he reads comp.lang.ada :-)