comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Wide Character Problem in Ada.Numerics
Date: 26 Apr 2007 10:43:57 -0700
Date: 2007-04-26T10:43:57-07:00	[thread overview]
Message-ID: <1177609437.376996.161050@n35g2000prd.googlegroups.com> (raw)
In-Reply-To: <sa4irbk6kv3.fsf@margay.local>

On Apr 25, 5:27 pm, Brian May <b...@snoopy.apana.org.au> wrote:
> >>>>> "Jean-Pierre" == Jean-Pierre Rosen <r...@adalog.fr> writes:
>
>     >> Wait a minute... are you saying that in GNAT, you cannot WITH a
>     >> package unless the source of the WITH'ed package uses the same
>     >> encoding as the source of the package doing the WITH'ing?
>     >> Ouch.  This somehow seems to run counter to the whole
>     >> philosophy of abstraction that packages are supposed to
>     >> provide.
>
> How do you expect the compiler to know what encoding is used for each
> source file? I think it could only know if the file was compiled
> first.

Well, the original example had a problem with a language-defined
package that was WITH'ed.  So surely that file must have been compiled
first?  By *somebody*???  I hope they're not releasing runtime
packages that they've never compiled!!!!!!

But in a more general case, the compiler, when it does compile a unit
that contains characters not in the 7-bit ASCII range, probably ought
to be generating some sort of information indicating what the source
encoding was, so that it would know how to reread the source when it's
WITH'ed.  (And, in particular, whatever file contains that information
for Ada.Numerics would be part of the GNAT release.)  And in a case
where you want to WITH a unit without compiling it first (although I
don't really understand why), it should be trivial to provide some
mechanism to generate that information without compiling.

In any case, this is not a difficult problem to solve.  And IMHO a
solution is necessary, if the alternative is to require that every
source in your environment, including sources delivered as part of the
runtime and sources that you might have downloaded from Sourceforge or
somewhere else on the web, use the same source encoding.  (Actually,
that might not even be bad if they all used UTF-8.  But requiring that
every source use some nonstandard encoding method---well, yuck.)

                                         -- Adam




  reply	other threads:[~2007-04-26 17:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-23 21:29 Wide Character Problem in Ada.Numerics david.smith
     [not found] ` <462daae8$1@news.post.ch>
2007-04-24  8:03   ` Jean-Pierre Rosen
2007-04-24 16:35     ` Adam Beneschan
2007-04-25  8:28       ` Maciej Sobczak
2007-04-25  9:02       ` Jean-Pierre Rosen
2007-04-26  0:27         ` Brian May
2007-04-26 17:43           ` Adam Beneschan [this message]
2007-04-27  0:35             ` Brian May
2007-04-27 12:08             ` Jean-Pierre Rosen
2007-04-27 15:41               ` Adam Beneschan
2007-04-27 16:43                 ` Ray Blaak
2007-04-27 19:04                   ` Randy Brukardt
2007-04-25 10:01       ` Markus E Leypold
2007-04-24  9:16   ` Georg Bauhaus
2007-04-24 17:54 ` Pascal Obry
2007-04-26  2:31   ` David Smith
2007-04-26 19:03     ` Pascal Obry
2007-04-26 19:41       ` Georg Bauhaus
2007-04-26 20:30         ` Pascal Obry
2007-04-27  1:47       ` Adam Beneschan
2007-04-27  2:51         ` David Smith
replies disabled

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