From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_05, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 4 Feb 91 From: Eric Gustafson Subject: An equilivant to Pascal's WITH in Ada?? Message-ID: <9104210400.AA06564@ajpo.sei.cmu.edu> List-Id: In the process of translating Pascal, Turbo 5.5, code to Ada, Meridan, I and the other members of my class group found that there was no equalivent to the pascal WITH statement. After some discussion we could not think of any reason why the facility would cause *bad* programming practices. The posibility of placing each data structure in a package and then WITH/USEing the structure was proposed, but this then makes the structure visable to the entire package or procedure that USEes it. This is not the desired effect. Has anyone else faced this problem, I would think this question has been asked before now. If so what was the method used or why would a pascal WITH structure be undesirable in Ada. Example ( In Pascal ): .. Type PersonRec = Record Name : String; Age : Integer; ID : Integer; end; { PersonRec } .. Var Person : PersonRec; .. WITH Person do begin Name := 'Asdfg'; Age := 24; ID := 123930; end; { with person } .. Any help would be appreciated as the code we are translating makes extensive use of this feature and we feal that ada should, bar any opposing rational, offer this feature. Please send replies to me personally as well as the list. The account used to receive mail is shared by about 20 people and some issues are inadvertantly removed before all get a chance to read them. Please also include my name in the subject line as this is how we distinguish personal mail for each member of the single bitnet account. Thank's in advance, /-----------------------------------------------------------------------------\ | ece490@valpo.bitnet | | --------------------------------------------------------------------------- | | "If it makes sense, then it doesn't cost cents !" | \-----------------------------------------------------------------------------/