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-Thread: 103376,5bcc293dc5642650 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.11.199 with SMTP id s7mr17921824pbb.5.1318690174467; Sat, 15 Oct 2011 07:49:34 -0700 (PDT) Path: d5ni11447pbc.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Why no Ada.Wide_Directories? Date: Sat, 15 Oct 2011 16:47:55 +0200 Organization: cbb software GmbH Message-ID: <1gzuyf8eg0o0k.7yo8q1lqfiyr.dlg@40tude.net> References: <9937871.172.1318575525468.JavaMail.geo-discussion-forums@prib32> <418b8140-fafb-442f-b91c-e22cc47f8adb@y22g2000pri.googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: EMY6V9w2JsuJ/8EEiAFEEw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news2.google.com comp.lang.ada:13966 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-10-15T16:47:55+02:00 List-Id: On Sat, 15 Oct 2011 09:12:39 -0400, Peter C. Chapin wrote: > On 2011-10-15 04:38, Dmitry A. Kazakov wrote: > >> There are two problems with the standard: >> >> 1. It does not define strings and characters in terms of a code point type >> to be consistent with Unicode; >> >> 2. It does not provide automatic conversions between character/string >> types, because of the problem #1, and because the Ada type system is too >> weak for that. >> >> Clearly file operations, directory operations, character maps should be >> defined using code points rather than characters. There should be only one >> instance of each operation/package independent on the encoding and the >> combinations of encodings. > > Disclaimer: I haven't thought about this very much. > > It seems like you are expecting too much from the standard. If a > standard program writes files with names that the standard understands > then a standard program can read those files back and manipulate them > via Ada.Directories. Yes? Maybe, it is difficult to guess. Anyway, what you say is a much bigger expectation than mine. I wished mere consistency of Ada string types with Unicode (after all Ada adopted Unicode), which is all internal language matter. What you are expecting is certain behavior of the language environment, which Ada cannot control at all. > The problem arises when you try to ask a standard program to delve into > system specific details such as reading arbitrary ("exotic") file names > supported by the system. There is no such thing. Unicode was introduced in order to support any thinkable names. > C avoids this complexity by just not including directory manipulation in > the standard at all. Ada at least allows a standard program to > manipulate directories containing files written by another standard program. As a matter of fact, it does not. Consider an Ada program creating a file in its current directory. Let the directory path contain Unicode characters outside Latin-1. Then another Ada program running in a different directory won't be able to find this file. In fact you cannot even walk the file system tree/forest using Ada.Directories. You cannot do this neither portably, nor even system-dependent. And it is just silly to make the point that Ada programs should read/write only files created by other Ada programs [compiled by the same compiler, I guess]. However even this is not guaranteed. > I can understand that it might be nice to extend the standard to include > proper support for Unicode file names and such. Ada is Unicode. > But I don't think the > lack of that support can be interpreted as some kind of failure of the > standard. Maybe it was a success, but some people really wished Ada.Directory be usable for developing portable GUI programs. Presently I am using GIO instead of Ada.Directory, and it does not make me happy. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de