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,803df5f3f60558d5 X-Google-Attributes: gid103376,public From: ica2ph@alpha1.csv.ica.uni-stuttgart.de (Peter Hermann) Subject: Re: Uninitialized "out" parameters Date: 1996/07/23 Message-ID: <4t20tb$1bum@info4.rus.uni-stuttgart.de>#1/1 X-Deja-AN: 169666037 references: <4som64$775@newsbf02.news.aol.com> organization: Comp.Center (RUS), U of Stuttgart, FRG newsgroups: comp.lang.ada Date: 1996-07-23T00:00:00+00:00 List-Id: Tucker Taft (stt@henning.camb.inmet.com) wrote: : It is hard to know which error is more common, the Ada 83 : one where you create a local read/write variable and then forget to : assign it on all exit paths to the OUT parameter, or the Ada 95 : one where you forget to initialize the read/write OUT parameter. : Having experienced the Ada 83 situation for 10 years, I remember : having made the Ada 83 error several times. It is too early to tell me too ... and then quickly changing to John Herro's solution. (while grumbling ;-) : how it will compare in frequency to the Ada 95 error. : The main advantage is that it simplifies the language, since : you only have one rule -- initialize your variables -- rather than : two. Ada 83's unreadable OUT parameters require a special : paradigm, and introduce a second class of errors, when you need : to build up an answer incrementally. For the Ada83 class of errors I ask you for an example. I consider the current Ada95 rule a true source of errors and therefore a nasty property of the language. I could imagine an Ada2005 where the compiler is obliged to only allow any downstream reading of mode-"OUT"-parameters when the context clearly indicates a prior setting, whatever flow of control was taken before. BTW, under NO circumstances I would accept an incoming value of a formal OUT parameter as data to be processed. I am sure you all agree. I am not satisfied with the language concerning the handling of non-initialized variables in general. This has been discussed long time ago. I remember e.g. the efficiency aspect. -- Peter Hermann Tel:+49-711-685-3611 Fax:3758 ph@csv.ica.uni-stuttgart.de Pfaffenwaldring 27, 70569 Stuttgart Uni Computeranwendungen Team Ada: "C'mon people let the world begin" (Paul McCartney)