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: 12 Feb 93 23:51:51 GMT From: kronos.arc.nasa.gov!butch!LMSC5.IS.LMSC.LOCKHEED.COM!LJ10891@ames.arc.nas a.gov Subject: Re: What's the difference between... Message-ID: <93043.57111.LJ10891@LMSC5.IS.LMSC.LOCKHEED.COM> List-Id: ------------------------- Original Article ------------------------- >type Placement is range 0 .. 10; >subtype Placement is INTEGER range 0 .. 10; I'm no maven, but I'll give it a shot. The first declaration defines a new type whose base type is the infamous {anonymous integer}. The second declaration defines a subtype whose base type is the named type STANDARD.INTEGER. This subtype inherits all of the operations defined on its parent type. Illustrative example: X : INTEGER := 5; P1 : PLACEMENT_1 := 6; P2 : PLACEMENT_2 := 6; begin X := P1 + 3; --illegal: result type is PLACEMENT_1 P1 := X + 3; --illegal: result type is INTEGER P2 := X + 3; --legal P2 := X + 6; --CONSTRAINT_ERROR end; Hope that helps. Send comments to ghaddad@lunacity.com. Send flames to someone@who.needs.them. ------------------------------------------- I found these opinions on my doorstep, could you please give them a good home.