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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-16 10:19:40 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!dialin-145-254-045-211.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. Date: Thu, 16 Jan 2003 19:20:18 +0100 Organization: At home Message-ID: References: <1041908422.928308@master.nyc.kbcfp.com> <1041997309.165001@master.nyc.kbcfp.com> <1042086217.253468@master.nyc.kbcfp.com> <1042477504.547640@master.nyc.kbcfp.com> <1042651417.215661@master.nyc.kbcfp.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-045-211.arcor-ip.net (145.254.45.211) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1042741178 23217223 145.254.45.211 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:33095 Date: 2003-01-16T19:20:18+01:00 List-Id: Hyman Rosen wrote: > Dmitry A. Kazakov wrote: >> I think I explained why. But to avoid that discussion again, just take >> the unit solution for C++ you mentioned and try to implement a calculator >> for dimensioned values using it. > > No, I don't want to do that. If I did want to do that, > my solution would be inappropriate, but so what? It is not a universal solution. That's the point. A floating-point type is one for real logarithmic values. Are you sure that dimensioned values have no universal solution at all? > Part > of designing a program is deciding what is fixed at > compile-time and what is decided at run-time. Yes, but sometimes it is the language that forces you to decide. The question is again, is that a cruelty of the Universe or just an arbitrary defect of a particular language. > Ada has ranged types where the ranges are fixed at compile-time, They are not, up to some limit. But the problem is whether the language gives you an opportunity to define new numeric types without the restrictions you do not need and close enough to the theoretical performance limit for the remaining restrictions. Ada almost can this. [Almost, because one cannot make a private type "numeric" for the compiler.] > and records whose field names are fixed at compile-time, > and procedures whose parameters are fixed at compile-time. It is not very useful, I mean untyped containers if you point at that. What can you do with the elements of an "unknown" type? Only put them into another container. Ada is not Lisp. > Similarly, it has generics whose parameters are fixed at > compile-time. When I know what I need at compile-time, > why should I be required to funnel it through a mechanism > which is designed for run-time variation? No, this is wrong. This mechanism and generics are both designed *just* for variation. The nature of generics excludes run-time variation. This is a restriction. If you are trying to defend this restriction, then well, I admit that there are useful restrictions, but I see no advantages in this case. It is same as to claim that: generic Size : Natural; package ... is type My_String is record Text : String (1..Size); end record; is better than type My_String (Size : Natural) is record Text : String (1..Size); end record; Dispatching, discriminants, array bounds have no such restiriction. Moreover subtyping/subclassing enrich the structure of types, while generics just ignore types and relations between them. What's the use of a variation over a type set if you are unable to specify an element of the set? -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de