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-Thread: 103376,c9d5fc258548b22a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 02 Mar 2011 17:25:29 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.14) Gecko/20110221 Thunderbird/3.1.8 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <31c357bd-c8dc-4583-a454-86d9c579e5f4@m13g2000yqb.googlegroups.com> <05a3673e-fb97-449c-94ed-1139eb085c32@x1g2000yqb.googlegroups.com> <4d4c232a$0$28967$882e7ee2@usenet-news.net> <4D4D6506.50909@obry.net> <4d50095f$0$22393$882e7ee2@usenet-news.net> <4d6d56c4$0$11509$882e7ee2@usenet-news.net> <16u9ka51wbukr$.1fj2sb73j9rv6.dlg@40tude.net> <4d6d627b$0$11509$882e7ee2@usenet-news.net> <29c4lixc0ght$.14kkfz1kij135.dlg@40tude.net> <4d6d6afb$0$11509$882e7ee2@usenet-news.net> <1gz9984wwizn5.r619fw4z9o56.dlg@40tude.net> <4d6e5614$0$21954$882e7ee2@usenet-news.net> <4d6e64f5$0$21954$882e7ee2@usenet-news.net> In-Reply-To: <4d6e64f5$0$21954$882e7ee2@usenet-news.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4d6e6f79$0$7657$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 02 Mar 2011 17:25:29 CET NNTP-Posting-Host: 1fe15823.newsspool1.arcor-online.net X-Trace: DXC=?iJLh>_cHTX3jMoS^>72mlHCM X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:18703 Date: 2011-03-02T17:25:29+01:00 List-Id: On 02.03.11 16:40, Hyman Rosen wrote: > What prevented the GNATColl authors from providing such an > interface? It may not always be possible. Speaking more generally, there should be good reasons for relying on string literals that represent structured information. Such as calendar dates, which could easily be of a type other than string, in any language supporting user defined, structured types. structure { .y = 2011, .m = 3, .d = 2 } (I'll guess that PostgreSQL might let us define our own DATE types, named differently, though.) MySQL, for example, is very lenient. Sometimes in ways that must lead to "erroneous execution". You pass a value that is not a valid value of the type. An Ada compiler would tell you in similar situations. (So would a C compiler.) MySQL won't. It might warn if you ask it. But in "normal operation", it continues with whatever it is programmed to substitute for the incorrect value. CREATE TEMPORARY TABLE T (TM TIME NOT NULL); SELECT CAST('2011-02-02' AS DATE); +----------------------------+ | 2011-02-02 | +----------------------------+ SELECT CAST('02-02-2011' AS DATE); +----------------------------+ | NULL | +----------------------------+ INSERT INTO T VALUES ('02-02-2011'); Query OK, 1 row affected, 1 warning (0.00 sec) SELECT * FROM T; +----------+ | 00:00:02 | +----------+ INSERT INTO T VALUES ('02-02-2011'); Query OK, 1 row affected, 1 warning (0.00 sec) SHOW WARNINGS; +---------+------+-----------------------------------------+ | Warning | 1265 | Data truncated for column 'TM' at row 1 | +---------+------+-----------------------------------------+ The fact that MySQL still drives many sites will neither bring back the time spent fighting its leniency nor compensate for the amount of anger created when confronted with its idiosyncrasies. It is fast and cheap, though. That's why it drives many sites. A good (Ada) interface might try to provide a structured calendar date type. I doubt that such an interface will make the practical programmer happy.