From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Interpretation of extensions different from Unix/Linux?
Date: Tue, 18 Aug 2009 09:48:15 +0200
Date: 2009-08-18T09:47:34+02:00 [thread overview]
Message-ID: <1d0e8zv4oco66$.1qqitij5kmc4w$.dlg@40tude.net> (raw)
In-Reply-To: h6cll1$q3i$1@munin.nbi.dk
On Mon, 17 Aug 2009 17:28:44 -0500, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:cbxuxz06dr5r$.9zo0supfl50x.dlg@40tude.net...
>> On Fri, 14 Aug 2009 18:54:40 -0500, Randy Brukardt wrote:
> ...
>>> You mean, "Ada cannot provide this optimally". As far as the ARG is
>>> concerned, a UTF-8 encoded string is a String. We looked at other options
>>> and decided they weren't worth the effort.
>>
>> But UTF-8 encoded string is a Wide_Wide_String. The elements of a Unicode
>> string are code points (Wide_Wide_Character). It is only the
>> representation
>> which is a string of octets (not Character!). Who should care of
>> representations in Ada?
>
> If course you care of representations. A Wide_Wide_String takes 4 times as
> much space as a UTF-8 encoded string, which can be a severe performance
> drag. And if you *don't* care about representation, then just store
> everything as Wide_Wide_String and do not worry about the representation at
> all.
Wide_Wide_String is an interface of UTF-8 string. It is *not* its
representation. Consider it in not-Ada:
type Wide_Wide_String is interface
array (Positive range <>) of Wide_Wide_Character;
type Octet_No is range 1..<implementation_defined>;
type Octet is mod 2**8:
type UTF8_String is new Wide_Wide_String with
array (Octet_No range <>) of Octet;
> For Ada purposes, UTF-8 is a storage format, not an operation format. You
> manipulate a Wide_Wide_Character string, then convert to/from UTF-8 for
> storage only.
You manipulate it as Wide_Wide_String without conversions. The only serious
problem is that replacing a character in UTF8_String might change its
"octet" bounds and converse changing octets may change "character" bounds.
>> Maybe, but these are not "true" roots of the file system.
>
> What is a "true" root? There are only file names which form roots (that is,
> cannot be decomposed further and still give a file or directory). It doesn't
> matter where the storage is or what the technology is.
"Untrue" roots are those Windows itself does not understand. There is a
large percentage of Windows programs that do not handle file names with
\\-stuff.
>> If Ada.Directories is provided it must be specified as a useful package.
>> Its implementation under Windows or Unix (of which file system is no less
>> broken) is not a matter of concern. I see no problem with traps or even Ada
>> RTL starting processes and system services, if Ada.Directories has been
>> used by the executable. If it comes with this price I buy it. What I do not
>> buy is writing OS-dependent code myself.
>
> I agree, but the problem is that you are asking to write code that you ought
> not even be writing for Windows (and probably not for Unix as well). Ada
> shouldn't be in the business of encouraging you to write stupid code.
Sorry, but writing a file browser is not stupid. Consider implementation of
a GUI open-file dialog using Ada.Directories.
>>> [And, yes, I agree with you that they shouldn't even have "=", but blame
>>> Ichbiah for making these things Strings. It's 25 years to late to change
>>> that definition.]
>>
>> No need to change, just overload it.
>
> Can't overload "=" for type String, as it is in Standard and the predefined
> one is always visible. Any overloaded one would (almost) never be visible
> (use visibility has lower priority than things in Standard).
It is not a String, it is a private type like Directory_Entry. You have to
overload Open, Create, Delete and Rename. That is.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2009-08-18 7:48 UTC|newest]
Thread overview: 104+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-01 17:53 Interpretation of extensions different from Unix/Linux? vlc
2009-08-02 17:13 ` Jacob Sparre Andersen
2009-08-04 11:31 ` vlc
2009-08-04 11:44 ` Jacob Sparre Andersen
2009-08-04 11:57 ` Georg Bauhaus
2009-08-04 12:29 ` vlc
2009-08-04 13:43 ` Dmitry A. Kazakov
2009-08-14 4:33 ` Randy Brukardt
2009-08-14 7:37 ` Dmitry A. Kazakov
2009-08-04 12:25 ` vlc
2009-08-04 19:18 ` Jeffrey R. Carter
2009-08-04 19:52 ` Dmitry A. Kazakov
2009-08-04 20:45 ` Jeffrey R. Carter
2009-08-04 21:22 ` Dmitry A. Kazakov
2009-08-04 22:04 ` Jeffrey R. Carter
2009-08-05 8:33 ` Dmitry A. Kazakov
2009-08-05 16:07 ` Jeffrey R. Carter
2009-08-05 16:35 ` Dmitry A. Kazakov
2009-08-05 17:49 ` Jeffrey R. Carter
2009-08-05 18:16 ` Dmitry A. Kazakov
2009-08-05 19:27 ` Jeffrey R. Carter
2009-08-05 19:50 ` Dmitry A. Kazakov
2009-08-05 20:46 ` Jeffrey R. Carter
2009-08-06 7:43 ` Dmitry A. Kazakov
2009-08-05 21:33 ` Robert A Duff
2009-08-05 19:45 ` vlc
2009-08-05 19:56 ` Dmitry A. Kazakov
2009-08-14 4:56 ` Randy Brukardt
2009-08-14 8:01 ` Dmitry A. Kazakov
2009-08-14 23:02 ` Adam Beneschan
2009-08-14 23:54 ` Randy Brukardt
2009-08-15 8:10 ` Dmitry A. Kazakov
2009-08-15 12:49 ` Pascal Obry
2009-08-15 13:23 ` Dmitry A. Kazakov
2009-08-15 15:11 ` Pascal Obry
2009-08-15 17:11 ` Dmitry A. Kazakov
2009-08-15 20:07 ` Pascal Obry
2009-08-16 7:26 ` Dmitry A. Kazakov
2009-08-17 22:28 ` Randy Brukardt
2009-08-18 0:32 ` Adam Beneschan
2009-08-18 20:48 ` Randy Brukardt
2009-08-19 4:08 ` stefan-lucks
2009-08-19 22:01 ` Randy Brukardt
2009-08-19 7:37 ` Jean-Pierre Rosen
2009-08-19 16:10 ` Adam Beneschan
2009-08-19 22:11 ` Randy Brukardt
2009-08-18 7:48 ` Dmitry A. Kazakov [this message]
2009-08-18 20:37 ` Randy Brukardt
2009-08-19 8:04 ` Dmitry A. Kazakov
2009-08-19 10:32 ` Georg Bauhaus
2009-08-19 12:11 ` Dmitry A. Kazakov
2009-08-19 15:21 ` Georg Bauhaus
2009-08-19 22:40 ` Randy Brukardt
2009-08-20 8:00 ` Variable- and fixed-length-character strings (Was: Interpretation of extensions different from Unix/Linux?) Jacob Sparre Andersen
2009-08-20 19:40 ` Interpretation of extensions different from Unix/Linux? Dmitry A. Kazakov
2009-08-21 0:08 ` Randy Brukardt
2009-08-21 7:43 ` Dmitry A. Kazakov
2009-08-21 22:10 ` Randy Brukardt
2009-08-22 7:27 ` Dmitry A. Kazakov
2009-09-01 1:50 ` Randy Brukardt
2009-09-01 7:28 ` Dmitry A. Kazakov
2009-09-02 3:41 ` Stephen Leake
2009-09-02 7:17 ` Dmitry A. Kazakov
2009-09-02 19:49 ` tmoran
2009-09-03 7:41 ` Dmitry A. Kazakov
2009-09-03 17:27 ` tmoran
2009-09-03 20:44 ` Dmitry A. Kazakov
2009-09-03 22:22 ` Randy Brukardt
2009-09-04 7:40 ` Dmitry A. Kazakov
2009-09-05 1:58 ` Randy Brukardt
2009-09-05 2:08 ` Randy Brukardt
2009-09-05 8:59 ` Dmitry A. Kazakov
2009-08-21 10:11 ` Enumeration of network shared under Windows (was: Interpretation of extensions different from Unix/Linux?) Dmitry A. Kazakov
2009-08-15 16:01 ` Interpretation of extensions different from Unix/Linux? Vadim Godunko
2009-08-16 13:13 ` Stephen Leake
2009-08-14 4:46 ` Randy Brukardt
2009-08-14 9:00 ` Dmitry A. Kazakov
2009-08-04 21:19 ` vlc
2009-08-14 5:19 ` Randy Brukardt
2009-08-14 6:13 ` Wilcards in Linux (was: Interpretation of extensions different from Unix/Linux?) stefan-lucks
2009-08-14 6:24 ` stefan-lucks
2009-08-14 10:05 ` Wilcards in Linux Markus Schoepflin
2009-08-14 10:22 ` Ludovic Brenta
2009-08-14 18:20 ` Tero Koskinen
2009-08-19 20:39 ` Interpretation of extensions different from Unix/Linux? Keith Thompson
2009-08-19 22:09 ` Robert A Duff
2009-08-20 7:49 ` Jacob Sparre Andersen
2009-08-20 15:56 ` Adam Beneschan
2009-08-20 21:58 ` sjw
2009-08-20 19:44 ` Robert A Duff
2009-08-20 21:34 ` Adam Beneschan
2009-08-20 22:03 ` (see below)
2009-08-21 0:55 ` tmoran
2009-08-20 23:55 ` Randy Brukardt
2009-08-21 17:58 ` Keith Thompson
2009-08-21 18:34 ` Dmitry A. Kazakov
2009-08-21 19:32 ` Jeffrey R. Carter
2009-08-21 21:34 ` Robert A Duff
2009-08-21 22:06 ` Hyman Rosen
2009-08-24 19:51 ` Keith Thompson
2009-08-28 0:27 ` Robert A Duff
2009-08-28 13:15 ` Anders Wirzenius
2009-08-28 15:02 ` Robert A Duff
2009-08-21 8:45 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox