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,a84eaf8fb2470909 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada generics Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1166710494.869393.108730@a3g2000cwd.googlegroups.com> <17fe4xfogg7p5.1dcyc5nyc2gsl.dlg@40tude.net> <1166805696.291429.239590@48g2000cwx.googlegroups.com> <186qujlcx6rwl.1h6eq4mbdaa5s$.dlg@40tude.net> <1167150212.165097.289010@73g2000cwn.googlegroups.com> <1qmdvus6du3xu.1n21tzgev46ia$.dlg@40tude.net> Date: Wed, 27 Dec 2006 10:21:00 +0100 Message-ID: NNTP-Posting-Date: 27 Dec 2006 10:20:56 CET NNTP-Posting-Host: 25fa7f7e.newsspool4.arcor-online.net X-Trace: DXC=hmoE[iFCCI1;]cDoEWD6A44IUKG<=]J5YIWC5UQSFFIcHdD2 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8024 Date: 2006-12-27T10:20:56+01:00 List-Id: 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

void foo ... > > 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, NN)? [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