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=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: Wed, 24 Apr 91 09:12 EST From: Subject: RE: WITH in Pascal Message-ID: <9104241316.AA23057@ajpo.sei.cmu.edu> List-Id: Eric Gustafson writes: > 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 WITH allows the variable name to be significantly separated from the operations done to its fields. This is a bad programming practice. >... what was the method used .. in Ada. the aggregate assignment (ref: Cohen _Ada as a Second Language_, pp 206..): >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 } >.. In Ada: Person := ( Name => "Asdfg", Age => 24, ID => 123930); ....Dennis Martin