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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,73b34c20caa911d1 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Math on dimensioned quantities Date: 1996/07/10 Message-ID: #1/1 X-Deja-AN: 167493013 references: <9607091345.AA03915@most> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-07-10T00:00:00+00:00 List-Id: In article <9607091345.AA03915@most>, W. Wesley Groleau (Wes) wrote: >writers listening?--how about a pragma similar to > > pragma Disallow ( Operation => "*", For_Type => Inch ); How about: function "*"(X, Y: Inches) return Inches is <>; ? Then this particular "*" is abstract and therefore can't be called, and this is checked at compile time. You can still multiply inches*inches to get square-inches. It's annoying that you might have to declare lots of "is <>" functions, but I think it does solve the problem. Make sure this is declared in the same package as type Inches; otherwise all kinds of weirdness can happen. - Bob