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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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 12:47:27 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!falcon.america.net!sunqbc.risq.qc.ca!news.maxwell.syr.edu!isdnet!enst!enst.fr!not-for-mail From: "Robert C. Leif, Ph.D." Newsgroups: comp.lang.ada Subject: RE: Static typing (Was Re: Better support for garbage collection) Date: Fri, 30 Mar 2001 12:44:57 -0800 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 985985194 15354 137.194.161.2 (30 Mar 2001 20:46:34 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 30 Mar 2001 20:46:34 +0000 (UTC) To: Return-Path: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 In-Reply-To: <3ac446f0.1707484@news.cis.dfn.de> Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.3 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: supernews.google.com comp.lang.ada:6270 Date: 2001-03-30T12:44:57-08:00 From: Bob Leif To: Dmitry Kazakov et al. Are you proposing that Universal_Integer, Universal_Float, Universal_Character, etc. become visible types that can be explicitly used in type conversions including where an object of a type like integer can be converted to being of type Universal_Integer. Would it include subprograms like: function "+" (Left : Integer'Base; Right : Universal_Integer) return Integer'Base; This would be very useful, since it would facilitate the use of private numeric types. I have yet to be able to cleanly use a private type Data_16_Type and directly add a literal to it. I would like: function To_Data_16_Type(The_Universal_Integer: Universal_Integer) return Data_16_Type; In essence these Universal_Types could now be used to explicitly specify the classes of integers, floats, and characters. I can see the danger of permitting programming with weakened types. However, these types could be included in a separate package Standard.Universal and be subject to the Pragma Restrictions or equivalent. -----Original Message----- From: comp.lang.ada-admin@ada.eu.org [mailto:comp.lang.ada-admin@ada.eu.org]On Behalf Of Dmitry Kazakov Sent: Friday, March 30, 2001 1:17 AM To: comp.lang.ada@ada.eu.org Subject: Re: Static typing (Was Re: Better support for garbage collection) 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