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-7-bit X-Google-Thread: 103376,fd63afa4dc364b7e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-30 01:17:15 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!news-out.cwix.com!newsfeed.cwix.com!news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!ailinel.cbb-automation.DE!not-for-mail From: dmitry@elros.cbb-automation.de (Dmitry Kazakov) Newsgroups: comp.lang.ada Subject: Re: Static typing (Was Re: Better support for garbage collection) Date: Fri, 30 Mar 2001 09:16:45 GMT Message-ID: <3ac446f0.1707484@news.cis.dfn.de> References: <98m938$2iod0$1@ID-25716.news.dfncis.de><98pgs1$32up7$1@ID-25716.news.dfncis.de><98umc6$39coj$1@ID-25716.news.dfncis.de> <4mzw6.414$OQ6.73321643@newssvr16.news.prodigy.com> NNTP-Posting-Host: ailinel.cbb-automation.de (212.79.194.99) X-Trace: fu-berlin.de 985943806 3304423 212.79.194.99 (16 [77047]) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: supernews.google.com comp.lang.ada:6235 Date: 2001-03-30T09:16:45+00:00 List-Id: On Thu, 29 Mar 2001 23:46:04 GMT, Robert A Duff wrote: >"Ken Garlington" writes: > >> "Robert A Duff" wrote in message >> news:wccvgotscxo.fsf@world.std.com... >By the way, the "ulterior motive" in my ideas about literals is that >what I *really* want is user-defined literals. I think the programmer >should be able to say "this type here has literals", and define which >forms are legal for that type, and what they mean. But in order to >avoid chaos, we can't have the form of the literal affecting overload >resolution. I strongly support your intention (user-defined literals and surely user-defined aggregates), but I believe that the way is wrong. I would say that a literal always has a type. And its type should be determinable from the literal's form. I like the idea that, 1 is a UNIVERSAL_INTEGER, 1.0 is a UNIVERSAL_FLOAT, 'a' is a UNIVERSAL_CHARACTER etc. Then if I want to have 1 acceptable as a value for MY_OWN_INTEGER, or for MY_OWN_FLOAT, or even for MY_OWN_FILE_DESCRIPTOR, I (or the language, if the type is derived etc) should simply provide a conversion from UNIVERSAL_INTEGER to my type. Here you are. IMO the actual problem is not inventing some complex overloading rules, but supporting type conversions. (For purists: there are type conversions in Ada, for instance there is one from a derived type to its base) Regards, Dmitry Kazakov