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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a1b8a8cd64f5256 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: Hi all. Novice question. Date: 1999/09/04 Message-ID: <37d0f836@news1.us.ibm.net> X-Deja-AN: 520956673 Content-transfer-encoding: 7bit References: <37D0D701.90F1B6F0@interact.net.au> X-Trace: 4 Sep 1999 10:45:10 GMT, 129.37.62.234 Organization: Global Network Services - Remote Access Mail & News Services X-Notice: should be reported to postmaster@ibm.net Content-Type: text/plain; charset="US-ASCII" Mime-version: 1.0 Newsgroups: comp.lang.ada X-Complaints-To: postmaster@ibm.net Date: 1999-09-04T00:00:00+00:00 List-Id: In article <37D0D701.90F1B6F0@interact.net.au> , G wrote: > I am interested in designing simulations. I have a philosophical > interest in ontology (the study of being and existence) ... Me too. I also have an interest in the philosophy of science, especially now because of those creationist pinheads in Kansas. > ... and I believe that this relates to entities and objects in programming. Indeed it does. Actually, biology relates to programming too. The study of evolution of natural systems (Darwinian theory) can be most helpful in understanding the evolution of artificial systems, especially large, complex software systems. Manny Lehman wrote a whole book on the subject. But the programmers who grow up in Kansas will never know this, because those idiots on the Kansas State Board of Education decided that Darwinian evolutionary theory doesn't need to be taught! > I am a novice... so please do not shoot me down in flames for doing something > completely anathema to ada principles. I'll be nice. ;^) > package M1A2_Abrams is > > private type M1A2_Abrams; This should be type M1A2_Abrams_Type is private; -- if you want assignment, i.e. Tank_1 := Tank_2 or type M1A2_Abrams_Type is limited private; -- if you don't want assignment or package Tanks is type Root_Tank_Type is abstract tagged limited private; end Tanks; package Tanks.M1A2_Abram is type Tank_Type is new Root_Tank_Type with private; However, you're going to have declare the full view of the type in the private region of the spec: package M1A2_Abrams is type Tank_Type is limited private; private type Tank_Type is limited record end record; end M1A2_Abrams; > end M1A2_Abrams; > > ------------------------------- > > package body M1a2_Abrams is > > type Physical_Specification is new Float; > > type Weapon_Specification is (M256_120_00mm_Smooth_Bore_Cannon, > M240_7_62mm_Machine_Gun, M240_7_62mm_Machine_Gun_Skate_Mount, > M2_0_50mm_Machine_Gun); > > type Mobility_Specification is new Float; > > type Engine is (Gas_Turbine); > > type Transmission is (Hydro_Kinetic); > > type Misc_Parameters is (Nbc_System); > > type Crew is new Integer; All these supplementary types should probably go in the somewhere in the spec. > -- Type => M1a2 Abrams > type M1a2_Abrams is > record > -- Type => Physical_Specification. > Weight : Physical_Specification := 69.54; -- tons > Length_Gun_Forward : Physical_Specification := 387.0; -- inches > Turret_Height : Physical_Specification := 93.5; -- > Width : Physical_Specification := 144.0; -- > Ground_Pressure : Physical_Specification := 15.4; -- PSI > Power_Weight_Ratio : Physical_Specification := 21.6; -- hp/ton > > -- Type => Weapon_Specification. > Main_Armament : Weapon_Specification := > M256_120_00mm_Smooth_Bore_Cannon; -- 120 mm > Coaxial_Weapon : Weapon_Specification := > M240_7_62mm_Machine_Gun; -- 7.62 mm > Loaders_Weapon : Weapon_Specification := > M240_7_62mm_Machine_Gun_Skate_Mount; > Commanders_Weapon : Weapon_Specification := > M2_0_50mm_Machine_Gun; -- .50 mm > > -- Type => Mobility_Specification. > -- Conversion to metric pending. > Maximum_Speed : Mobility_Specification := 42.0; -- 42.0 mph > (Governed) > Cross_Country_Speed : Mobility_Specification := 30.0; -- mph > Speed_10pc_Slope : Mobility_Specification := 17.0; -- mph > Speed_60pc_Slope : Mobility_Specification := 4.1; -- mph > Acceleration_0_To_20 : Mobility_Specification := 7.2; -- seconds > Cruising_Range : Mobility_Specification := 265.0; -- miles > Obstacle_Crossing : Mobility_Specification := 42.0; -- inches > Vertical_Trench : Mobility_Specification := 9.0; -- feet > > -- Type => Engine. > M1a2_Engine : Engine := Gas_Turbine; > > > -- Type => Transmission. > M1a2_Transmission : Transmission := Hydro_Kinetic; > > -- Type => Misc_Parameters. > M1a2_Air_Control : Misc_Parameters := Nbc_System; -- Clean, > cooled air > > -- Type => Crew. > M1a2_Crew : Crew := 4; > > end record; This looks like it should go in the private part of the spec. > end M1a2_Abrams; > I am teaching myself this stuff, so understand that before you grill me. > Any feedback is useful. Can an object be defined as a record like this and -- > does it make sense to do so (?). You should probably spend a few hours with an Ada tutorial. Try Lovelace, or some other one. They're all available at the adahome and adapower pages; just follow the tutorial links. -- Matt It is impossible to feel great confidence in a negative theory which has always rested its main support on the weak points of its opponent. Joseph Needham, "A Mechanistic Criticism of Vitalism"