comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: What about a glob standard method in Ada.Command_Line ?
Date: Wed, 25 Aug 2010 16:56:26 +0200
Date: 2010-08-25T16:56:24+02:00	[thread overview]
Message-ID: <17uj112bzfc47$.1jlqotsp6zuup.dlg@40tude.net> (raw)
In-Reply-To: 4c752693$0$7656$9b4e6d93@newsspool1.arcor-online.net

On Wed, 25 Aug 2010 16:20:03 +0200, Georg Bauhaus wrote:

> On 25.08.10 15:30, Dmitry A. Kazakov wrote:
> 
>> If code points have nothing to do with String why do you propose to do it
>> with String?
> 
> Because file names as entities external to Ada have got nothing
> to do with code points, from an Ada point of view: file names
> have to do with Strings, though. This is in part a consequence
> of how subprogram parameters in Directories.Start_Search were
> chosen.

Yes, that is the point: Ada.Directories is broken.

> Conclusion: there cannot be a good, portable Ada type
> representing file names.

From false premises follows anything. Certainly and without any doubt it is
possible to provide an abstraction which would work for Posix, Unix,
Windows, VMS, MacOS and name what OS.

> Start_Search is based on String; file names do not obey
> the rules of ISO 10646; no hope.

As I said it is broken. Broken things to be repaired or disposed. Since the
ARG cannot change OS they should look forward to change the RM.

> From here, one can go on to a different type from the
> collection that covers Unicode.

I am one who uses "Ada String means UTF-8 encoded string". Surely this
works. Since Ada.Directories is unusable, I deploy Glib bindings instead.
At least they cared to define file paths UTF-8. But the approach is wrong
because it mangles encoding and the contents. If I were to redesign
Ada.Directories, I would use a clone type of Wide_Wide_String for file
names. If Ada had array interfaces I would do it otherwise. But in any case
file name would not be string, file path would not be a file name etc.

>> It could
>> represent some encoding of οΏ½*, which is the point.
> 
> Exactly.  And since there is no single, well defined,
> portable οΏ½ for file names,

It is same as to say that there is no portable Integer type. Unicode code
points are portable because they are defined so.

If some name is not a valid file name you get Name_Error, likewise you get
Constraint_Error if some integer is not valid number for the given machine.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2010-08-25 14:56 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-21  4:47 What about a glob standard method in Ada.Command_Line ? Yannick Duchêne (Hibou57)
2010-08-21  6:41 ` J-P. Rosen
2010-08-21  7:21   ` Yannick Duchêne (Hibou57)
2010-08-21  9:11   ` Pascal Obry
2010-08-22 19:00     ` J-P. Rosen
2010-08-22 19:29       ` Yannick Duchêne (Hibou57)
2010-08-23 23:06       ` Randy Brukardt
2010-08-24  0:02         ` Yannick Duchêne (Hibou57)
2010-08-24  0:24           ` Adam Beneschan
2010-08-24 10:27             ` Georg Bauhaus
2010-08-24 14:24               ` Dmitry A. Kazakov
2010-08-24 15:42                 ` Georg Bauhaus
2010-08-24 16:04                   ` Dmitry A. Kazakov
2010-08-24 17:10                     ` Georg Bauhaus
2010-08-24 17:24                       ` Georg Bauhaus
2010-08-24 18:42                         ` Yannick Duchêne (Hibou57)
2010-08-24 18:51                           ` Simon Wright
2010-08-24 17:41                       ` Dmitry A. Kazakov
2010-08-24 21:32                         ` Georg Bauhaus
2010-08-25  7:55                           ` Dmitry A. Kazakov
2010-08-25  8:24                             ` Yannick Duchêne (Hibou57)
2010-08-25 20:15                               ` (see below)
2010-08-25 20:39                                 ` Yannick Duchêne (Hibou57)
2010-08-25 21:05                                   ` (see below)
2010-08-25 21:32                                     ` Yannick Duchêne (Hibou57)
2010-08-25  8:57                             ` Georg Bauhaus
2010-08-25  9:28                               ` Dmitry A. Kazakov
2010-08-25 11:09                                 ` Georg Bauhaus
2010-08-25 12:01                                   ` Dmitry A. Kazakov
2010-08-25 13:09                                     ` Georg Bauhaus
2010-08-25 13:30                                       ` Dmitry A. Kazakov
2010-08-25 14:20                                         ` Georg Bauhaus
2010-08-25 14:56                                           ` Dmitry A. Kazakov [this message]
2010-08-25 15:51                                             ` Georg Bauhaus
2010-08-25 16:46                                               ` Dmitry A. Kazakov
2010-08-25 18:44                                                 ` Georg Bauhaus
2010-08-25 19:39                                                   ` Dmitry A. Kazakov
2010-08-26  0:59                                                     ` Georg Bauhaus
2010-08-26  8:49                                                       ` Dmitry A. Kazakov
2010-09-02 19:25                                                         ` Randy Brukardt
2010-09-02 20:47                                                           ` Dmitry A. Kazakov
2010-09-02 19:08                                                       ` Randy Brukardt
2010-09-02 20:48                                                         ` Georg Bauhaus
2010-08-22 19:30     ` Yannick Duchêne (Hibou57)
2010-08-22 19:46       ` Dmitry A. Kazakov
2010-08-25 13:09 ` anon
2010-08-25 13:13   ` Georg Bauhaus
2010-08-25 13:28     ` J-P. Rosen
2010-08-25 20:29       ` Yannick Duchêne (Hibou57)
2010-08-25 14:14     ` Jeffrey Carter
2010-08-25 21:37     ` anon
2010-08-26  8:21       ` J-P. Rosen
2010-08-26 16:29         ` anon
2010-08-26 20:34           ` Yannick Duchêne (Hibou57)
2010-08-27  4:40             ` Yannick Duchêne (Hibou57)
2010-08-27 12:10           ` J-P. Rosen
2010-09-01  8:08             ` Ada compilers and Ada 2005 (was: What about a glob standard method in Ada.Command_Line ?) Georg Bauhaus
2010-09-01  9:45               ` Ada compilers and Ada 2005 Pascal Obry
2010-09-01 10:28                 ` J-P. Rosen
2010-09-02 19:37                   ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox