comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: GNAT GPL Edition - on the plus side
Date: Sat, 15 Oct 2005 11:28:50 +0200
Date: 2005-10-15T11:28:37+02:00	[thread overview]
Message-ID: <5rv6uxpgk12.pv7zbyqkvumw.dlg@40tude.net> (raw)
In-Reply-To: 4350010e$0$24167$9b4e6d93@newsread4.arcor-online.net

On Fri, 14 Oct 2005 21:05:31 +0200, Georg Bauhaus wrote:

> Dmitry A. Kazakov wrote:
> 
>> It
>> seems that GNAT somehow messes up the names of the actual parameters with
>> ones of the formal parameters upon instantiation. At least some problems
>> can be circumventing by avoiding actual and formal parameter having the
>> same name! (:-))
> 
> Even when GNAT doesn't properly handle the load of overload,
> this defect might actually help improve software quality. :-)

Well, GNAT bugs often forced me to review my designs. It always is a good
idea to review... though I wouldn't give compiler bugs honor for that. Of
course if the error message were: "sorry, at the moment we cannot compile
your legal code, but if you change this and that ..." BTW, GNAT often says
X is invisible (because of ...) but *a* use clause might make it visible.
But it never reveals which one! (:-))

> A one-name-for-one-thing-rule has made it into a programming
> language standard (Eiffel), and I think the rule is justified.

Ooch, do you seriously claim that the following should be outlawed:

   procedure Foo (X : in out Integer);
--------------------------
   X : Integer;
begin
   Foo (X); -- Illegal: the same name for actual and formal! (:-))

BTW, the above is not one name, one thing. It is one name, two things.

If you really wanted to have one name, one thing, you ought to disallow all
sorts of renaming and use-ing. I don't think that would be a good idea. It
is true that renaming in Ada have problems, but those are rather design
problems, which can be relatively easily fixed:

1. Renaming should keep contracts
(Example: renaming that shifts array index shall either be illegal or
indeed shift it)

2. Renaming shall never, under any circumstances be able to hide the thing
it renames.

3. There must be renaming for types. It follows from 2, and anyway,

subtype S is T;

is a fundamentally different thing.

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



  reply	other threads:[~2005-10-15  9:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-14  1:41 GNAT GPL Edition - on the plus side Steve
2005-10-14  4:44 ` randomm
2005-10-14 10:12   ` Alex R. Mosteo
2005-10-14 10:37     ` Martin Dowie
2005-10-19  6:06   ` jussij
2005-10-14  5:55 ` Simon Wright
2005-10-14  8:10 ` Dmitry A. Kazakov
2005-10-14  9:36   ` Martin Dowie
2005-10-14 13:13   ` Marc A. Criley
2005-10-14 17:12     ` Dmitry A. Kazakov
2005-10-14 19:05       ` Georg Bauhaus
2005-10-15  9:28         ` Dmitry A. Kazakov [this message]
2005-10-15  0:00       ` Randy Brukardt
2005-10-15 14:45         ` Robert A Duff
2005-10-15 16:14           ` Dmitry A. Kazakov
2005-10-16  0:48             ` Robert A Duff
2005-10-16  9:56               ` Dmitry A. Kazakov
2005-10-14 13:50   ` Steve
2005-10-14 17:25     ` Dmitry A. Kazakov
2005-10-14 18:58       ` Georg Bauhaus
2005-10-15  9:31         ` Dmitry A. Kazakov
2005-10-15  1:45       ` Steve
2005-10-15 11:18         ` Simon Wright
2005-10-14 17:42   ` Pascal Obry
replies disabled

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