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: 16 Feb 93 15:03:55 GMT From: eachus@mitre-bedford.arpa (Robert I. Eachus) Subject: Re: What's the difference between... Message-ID: List-Id: In article <75650@cup.portal.com> R_Tim_Coslet@cup.portal.com writes: > Well, if you REALLY want this level of control, creat a package with all > your types in it and make them PRIVATE and only define the operations > that are actually physically correct. Then the compiler catches everything > at compile time. Actually, for this example the best choice is to use a fixed point type for Apples. The only predefined multiply and divide operations you get (that don't require conversions) are for multplication and division by integers: type Apples is delta 1.0 range 0.0..2.0**31; -- Use a smaller delta if you need to slice apples. subtype Crates is Integer range 0.0..Integer'LAST; -- Could use a type and define * and / for Apples, but then 2 * -- Apples would be ambiguous. A,T: Apples; C: Crates; begin T := A * C; -- OK; T := A * A; -- wrong. .. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...