comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada generics
Date: Wed, 27 Dec 2006 10:21:00 +0100
Date: 2006-12-27T10:20:56+01:00	[thread overview]
Message-ID: <lbkjzskf2pv3$.b28bwviakyyb$.dlg@40tude.net> (raw)
In-Reply-To: oekkh.5076$6f4.450@trndny08

On Wed, 27 Dec 2006 01:44:52 GMT, Hyman Rosen wrote:

> Dmitry A. Kazakov wrote:
>> The language should be defined in terms of code points.
>  > The encoding of is irrelevant.
> 
> And non-type template parameters are defined in terms of their
> values. The expression used to formulate them is irrelevant.

Yes, if that expression were outside the language. The "encoding language"
is outside the programming language, so it is not the language problem, if
any. But because the expressions used in templates are language expressions
you have to consider them there.

> An arbitrary-precision rational number package would be enough
> to make floating-point template parameters be portably defined.

No, it would not. Consider 1.0 / 3.0

> It's just not worth the work.
> 
>> matching by structure
> 
> To say that 1 + 1 and 2 are equivalent isn't matching by structure
> as far as I'm concerned, but we're not going to agree on that one.

Surely it is. The language does define the formula 1+1 trivially equivalent
to 2. So because 1+1 is a formula the compiler shall prove that in all
valid states P(1+1) <=> P(2). In Ada it were improvable.

>> We are talking not about floats, but about the principle of matching by
>> content. There is no any chance to hold on it:
>>    template <p> void foo<HALT(p)> ...
> 
> What's the problem with that? It's a compile-time operation on
> constants. The compiler will just trundle along and it will either
> halt, run out of resources, or continue running forever. All
> language standards allow compilers to impose resource constraints
> on the programs being compiled.

But it is not same as having legal finite programs which cannot be compiled
no matter how much resources you have. The set of all programs were
subdivided into:

W - illegal programs
T - legal, but fundamentally non-compilable
U L(N) - legal and compilable with N resources, N<oo

Now:

1. how easy one can modify p from L(N) to become T?
[very]

2. is there a way to determine if some p outside L(N) is from any L(M>N)?
[no]

3. what is the use of p from T?
[none]

4. is it decidable whether p is in T or in W?
[no]

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



  reply	other threads:[~2006-12-27  9:21 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21 14:14 Ada generics markww
2006-12-21 15:42 ` Dmitry A. Kazakov
2006-12-22  7:59   ` Martin Krischik
2006-12-22 16:14     ` Hyman Rosen
2006-12-22  7:59   ` Martin Krischik
2006-12-22 16:41   ` Hyman Rosen
2006-12-22 17:33     ` Markus E Leypold
2006-12-22 18:26       ` Hyman Rosen
2006-12-22 20:59         ` Markus E Leypold
2006-12-22 21:01           ` Markus E Leypold
2006-12-23 14:09           ` Marco
2006-12-25 14:23             ` Hyman Rosen
2006-12-29 14:13               ` Marco
2006-12-25 14:20           ` Hyman Rosen
2006-12-23 11:43     ` Dmitry A. Kazakov
2006-12-25 13:49       ` Hyman Rosen
2006-12-25 14:39         ` Dmitry A. Kazakov
2006-12-26  1:34           ` Hyman Rosen
2006-12-26  9:11             ` Dmitry A. Kazakov
2006-12-26 16:23               ` Hyman Rosen
2006-12-26 19:28                 ` Dmitry A. Kazakov
2006-12-27  1:44                   ` Hyman Rosen
2006-12-27  9:21                     ` Dmitry A. Kazakov [this message]
2006-12-27 19:06                       ` Hyman Rosen
2006-12-28 10:59                         ` Dmitry A. Kazakov
2006-12-28 16:29                           ` Hyman Rosen
2006-12-29 11:12                             ` Dmitry A. Kazakov
2006-12-29 14:56                               ` Hyman Rosen
2006-12-28 17:35                           ` Georg Bauhaus
2006-12-29 14:48                             ` Dmitry A. Kazakov
2006-12-29 19:39                               ` Georg Bauhaus
2006-12-30  9:58                                 ` Dmitry A. Kazakov
2006-12-30 14:53                                   ` Georg Bauhaus
2007-01-01 13:00                                     ` Dmitry A. Kazakov
2007-01-02 10:04                                       ` Georg Bauhaus
2007-01-02 11:11                                         ` Dmitry A. Kazakov
2007-01-02 12:33                                           ` Georg Bauhaus
2007-01-02 13:51                                             ` Dmitry A. Kazakov
2007-01-02 14:45                                               ` Georg Bauhaus
2007-01-03 10:10                                                 ` Dmitry A. Kazakov
2007-01-03 14:20                                                   ` Hyman Rosen
2007-01-03 14:55                                                   ` Georg Bauhaus
2007-01-04 10:15                                                     ` Dmitry A. Kazakov
2007-01-03 19:33                                           ` Alexander E. Kopilovich
2007-01-04 10:27                                             ` Dmitry A. Kazakov
2007-01-04 15:00                                               ` Alexander E. Kopilovich
2007-01-05 10:32                                                 ` Dmitry A. Kazakov
2006-12-30  2:25                               ` Randy Brukardt
2006-12-30 10:13                                 ` Dmitry A. Kazakov
2007-01-04  1:09                                   ` Randy Brukardt
2007-01-04 10:07                                     ` Dmitry A. Kazakov
2007-01-05  1:32                                       ` Randy Brukardt
2007-01-05  4:46                                         ` Randy Brukardt
2007-01-05  9:08                                         ` Jean-Pierre Rosen
2007-01-05 20:14                                         ` Georg Bauhaus
2007-01-06  0:14                                           ` Randy Brukardt
2006-12-29  0:09                           ` Randy Brukardt
2006-12-29 11:11                             ` Dmitry A. Kazakov
2006-12-30  2:40                               ` Randy Brukardt
2006-12-21 16:55 ` Hyman Rosen
2006-12-21 18:22   ` markww
2006-12-22  3:01 ` Steve
replies disabled

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