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 X-Google-Thread: 103376,9d303864ae4c70ad X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-11 03:14:40 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news.ntli.net!newsfeed.tiscali.ch!feed.news.tiscali.de!darth-vader.mobilixnet.dk!newsfeed.orangenet.dk!news.hacking.dk!pnx.dk!munin.nbi.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Expressing physical units Date: 11 Apr 2004 12:14:36 +0200 Organization: Munin Sender: sparre@sparre.crs4.it Message-ID: References: <5ad0dd8a.0404090512.15af2908@posting.google.com> <5ad0dd8a.0404100507.729d3577@posting.google.com> NNTP-Posting-Host: 80.241.165.47 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: munin.grove.home 1081678479 11705 80.241.165.47 (11 Apr 2004 10:14:39 GMT) X-Complaints-To: sparre@munin.nbi.dk NNTP-Posting-Date: Sun, 11 Apr 2004 10:14:39 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:6969 Date: 2004-04-11T12:14:36+02:00 List-Id: Hyman Rosen wrote: > Jacob Sparre Andersen wrote: > > It should be noted that my analysis was tied rather strongly to > > Ada, and a more relaxed programming language might be able to do > > something that would be sufficiently close to full compile-time > > unit checking. > > C++ can do full compile-time unit checking with no runtime overhead > as long as all units needed by the program are known at > compile-time. Yes. I am aware of that. - And that it is a much more elegant solution than the one I use do to do the same thing in Ada (in Ada you actually have to specify _each_ of the units you are going to use explicitly). > The technique uses templates, requires automatic instantiation of > templates for usability (and so cannot be done in Ada), Yes. I don't understand C++ templates well enough to be able to see if it is realistic to copy enough of it to Ada, to allow the easier handling of compile-time unit checking available in C++. I am afraid it would give too many unwanted possibilities in Ada, but it is very tempting. > and was published in Barton & Nackman, _Scientific and Engineering > C++_. I've often posted the technique, but here goes again, in a > simplified version: [...] Thanks. Jacob -- �USA fights for the right of the individual.� �Yes. Those of the individual George W. Bush.� -- with thanks to Olfax