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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1dd28d5040ded1f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-20 10:06:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!msc1.onvoy!ply1.onvoy!upp1.onvoy!onvoy.com!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!spool0900.news.uu.net!reader0902.news.uu.net!not-for-mail Message-ID: <3CE92D80.7040904@mail.com> Date: Mon, 20 May 2002 13:08:16 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0rc2) Gecko/20020510 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Announce: Grace project site operational References: <4519e058.0205140718.3ddb1b2a@posting.google.com> <3CE15D0A.3050100@mail.com> <2s44eu0fm4g6606h9p4stb1b5oc0nmg5u8@4ax.com> <3CE2A946.5030808@mail.com> <3CE40B8E.70102@mail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Cache-Post-Path: master.nyc.kbcfp.com!unknown@mosquito.nyc.kbcfp.com X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1021914414 reader2.ash.ops.us.uu.net 587 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:24426 Date: 2002-05-20T13:08:16-04:00 List-Id: Dmitry A. Kazakov wrote: > The idea of a generic is: let's substitute A for X > and see if the compiler will eat that. In the same way that a procedure is: let's substitute V for P and see if the compiler will eat that. Clearly, you dislike generics so you invent extra-linguistic nomenclature to claim that one language construct is within the language while another is not. > Because dimensioned values are not unrelated. Their types are > siblings, having a common supertype, and very often we need objects of > that supertype. Why is a kilometer at all related to an hour? Why do they need a common supertype? > an unconstrainted subtype of Measure shall keep the > discriminant, while a constrained one shall not. Same with tags, > class-wide objects have one, specific ones do not. What good is a "specific" tagged object without a tag? > your macro expansions (:-)) will probably eat even more. The C++ versions reduce to plain arithmetic. Object sizes are the same as the unadorned value representation. > How big will be your application, if all possible > subroutines dealing with units will be instantiated? Only the ones used get instantiated. If it turns out that too many routines are generated, the solution is to write a dynamic version and let the generic ones just call the dynamic one - template Stream &print(Stream &out, const RepType &value, int mass, int distance, int time) { /* similar to earlier version */ } template Stream &operator<<(Stream &out, const Unit &u) { return print(out, u.value, Mass, Distnace, Time); } > The moral of the story is that no real system > uses 100% static or 100% dynamic checks. This is not true. Many real systems use only static checks.