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,c7ea1cb7a2beb2ee X-Google-Attributes: gid103376,public From: Paul Graham Subject: Re: Disallowing Pre-Defined Operations Date: 2000/03/15 Message-ID: <38D013EF.1F431E34@cadence.com>#1/1 X-Deja-AN: 598013264 Content-Transfer-Encoding: 7bit References: <8a9eeg$qtv$1@newpoisson.nosc.mil> <8ababr$c3u$1@wanadoo.fr><8afhed$f9v$1@newpoisson.nosc.mil> <8aoifb$49f$1@newpoisson.nosc.mil> <38D001D7.4D6E4284@averstar.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Cadence Design Systems Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-03-15T00:00:00+00:00 List-Id: Tucker Taft wrote: > > "Charles H. Sampson" wrote: > > ... > > >You'll have to post the exact code if we're to understand what's going > > >on there (all of the ops declared, and the supposedly ambiguous > > >statement). And the error message. > > > > O. K., here's an example. It's not meant to meaningful, just to > > show the problem, although I hope that the name for the integer variable > > suggests how it could be used meaningfully. This example has been > The techniques using discriminants are unsatisfactory in my view, > and too "heavy." VHDL has the notion of "units" built into the language, > and its approach should probably be evaluated. In VHDL units are mainly used for type TIME. Things get complicated when you try to map the physical world onto unit data types. For instance: type time is ... type distance is ... type velocity is ... type acceleration is ... type mass is ... function "/"(x : distance; y : time) return velocity; function "/"(x : velocity; y : time) return acceleration; function "*"(x : mass; y : acceleration) return force; function "*"(x : force; y : distance) return work; ... Anyway, you can see that the set of units and possible operations between units grows very quickly. I wonder how big a complete physical types package would be (complete enough to represent all the equations in a physics or electonics textbook for instance)? Paul