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=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4bce46ddadaa9806 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: What is wrong here? (Generic and controlled types) Date: 2000/04/06 Message-ID: <8cia8a$v1j$1@nnrp1.deja.com>#1/1 X-Deja-AN: 607582256 References: <38E871E6.8D9EBE71@lufmech.rwth-aachen.de> <8caebe$6us$1@nnrp1.deja.com> <8cahmn$apq$1@nnrp1.deja.com> <38EC6B3E.9225F1D4@mail.com> X-Http-Proxy: 1.0 x23.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Thu Apr 06 15:25:19 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-04-06T00:00:00+00:00 List-Id: In article <38EC6B3E.9225F1D4@mail.com>, Mats Weber wrote: > I think the message is misleading (both the actual GNAT message and the > above modified version) in the sense that it does not direct the user to > the actual rule he is violating, which is that one cannot derive a > tagged type at a level deeper than its parent. Now there (to me) speaks the expert who knows far too much. An error message that said "tagged type cannot be derived at a level deeper than its parent" would be truly useless to almost all users. Most people don't even think of controlled types as tagged, and almost no one understands the concept of "level deeper". Yes, to the expert, many GNAT error messages are not 100% technically correct. This is by design. The issue is whether the message would mislead an expert, and the answer is of course no, because they understand the underlying reason. Many compilers to me generate far too much technical term gobbledygook. Indeed note that the objection that has arisen to this message is the (to me unanticipated) objection that library level is an obscure technical term. I consider this objection valid, and we will think about how to avoid this mistake. There may be an argument for making the RM technically precise and thus much less accessible (even there as you know I am a bit dubious), but arguing to make error messages more technically precise at the expense of accessibility would be a huge mistake I think. It is interesting to argue about whether an RM reference would help. The RM reference would indeed be to the section in the RM talking about rules for deriving tagged types in terms of accessibility levels. For putting the RM reference in: This helps to explain to an experienced and knolwedgable Ada programmer *where* the restriction comes from in the language design, but does not help fix the problem. Against putting the RM reference in: There are two kinds of programmers. Some will understand the message without the RM reference, and go fix things, without bothering to look at the RM. They don't need the RM reference! The second kind can't understand what the message means (note that we had some pretty skilled programmers responding in this thread that they were in this class). They will go looking up the RM reference hoping it will help them understand. The trouble is that this particular RM reference is very unlikely to be enlightening (remember we are talking about programmers who don't know what library level means). To me the balance of this argument says don't put in RM references. I notice that whenever we argue about the RM reference issue, it is almost always pretty expert programmers who want those references :-) But whereever that argument leads, to me the major task is to improve the quality of the error messages so that *in practice* more programmers fall into class one. Robert Dewar Sent via Deja.com http://www.deja.com/ Before you buy.