comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Bus error
Date: Fri, 29 Jun 2007 21:37:43 -0400
Date: 2007-06-29T21:37:43-04:00	[thread overview]
Message-ID: <wcck5tm6x3s.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: tk9ak6o26vr7.15x8n04sjd359.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> You missed the point. The renaming in my example shall *not* raise
> Constraint_Error. It is a clear language design fault.

Right -- the fact that "X: T renames ..." completely ignores the
constraints on T is a flaw.  There are language-lawyerly reasons for
it...

> Renaming is completely broken in Ada.

A little bit broken.

>...It creates new objects,

Heh?  Renaming does not create new objects.

A function call creates a new object, but that's a
different story.  And it's a good thing -- that function-result
object might need to be finalized, which means it has to be
an object (not just a value).

If I ran the circus, literals would "return" objects, too.
And there would be no syntactic distinction betweem "name"
and "expression".

>... it violates
> contracts,

Not sure what you mean there.  I guess the fact that constraints on T
are ignored, above.  If so, it doesn't violate any contract, so long as
you understand that "X: Positive renames..." is not a contract requiring
positive numbers.  ;-)

>...it introduces names conflicts.

Yes.  We considered fixing that during Ada 9X.

Here's another small complaint about renaming: It's often used as an
"import", as in:

    function Blah (...) return ... renames Some.Library.Package.Blah;

We do not wish to change the name of Blah, just to import it into
another scope.  But mentioning Blah twice is error-prone in that
context.  The programmer really wants to say something like
"import Blah from Some.Library.Package".  Consider:

    function "+"(...) return ... renames Some_Package."+";
    function "-"(...) return ... renames Some_Package."+";

Note cut&paste error on second line.

- Bob



  reply	other threads:[~2007-06-30  1:37 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0367891DA5DA7E408D42A860FA002F44B0CC48@sma2901.cr.eurocopter.corp>
2007-06-29  9:35 ` AW: Bus error Duncan Sands
2007-06-29 12:55   ` Dmitry A. Kazakov
2007-06-29 15:37     ` Markus E Leypold
2007-06-29 15:44     ` Georg Bauhaus
2007-06-29 20:07       ` Dmitry A. Kazakov
2007-06-30  1:37         ` Robert A Duff [this message]
2007-06-30  8:44           ` Dmitry A. Kazakov
2007-06-30 11:52             ` Georg Bauhaus
2007-06-30 13:16               ` Georg Bauhaus
2007-06-30 14:31               ` Dmitry A. Kazakov
2007-06-30 18:07                 ` Georg Bauhaus
2007-06-30 19:31                   ` Robert A Duff
2007-07-01  9:07                   ` Dmitry A. Kazakov
2007-06-30 15:40               ` Robert A Duff
2007-06-30 17:54                 ` Georg Bauhaus
2007-07-02  8:01           ` Jean-Pierre Rosen
2007-07-02 12:00             ` Dmitry A. Kazakov
2007-07-02 12:30               ` Jean-Pierre Rosen
2007-07-02 14:22             ` Robert A Duff
2007-06-30 13:14         ` Georg Bauhaus
2007-06-30 14:31           ` Dmitry A. Kazakov
2007-06-30 15:34             ` Robert A Duff
2007-07-01  8:34               ` Dmitry A. Kazakov
2007-07-01 15:39                 ` Robert A Duff
2007-07-01 19:41                   ` Dmitry A. Kazakov
2007-06-30 15:29           ` Robert A Duff
2007-06-30 17:41             ` Georg Bauhaus
2007-06-30 13:31         ` Markus E Leypold
2007-07-02  0:16           ` Robert A Duff
2007-06-29  9:23 AW: " Grein, Christoph (Fa. ESG)
2007-06-29 10:17 ` Dmitry A. Kazakov
  -- strict thread matches above, loose matches on Subject: below --
2007-06-27 14:23 Maciej Sobczak
2007-06-27 15:45 ` Georg Bauhaus
2007-06-27 17:19   ` Maciej Sobczak
2007-06-28  1:58     ` Robert A Duff
2007-06-28 20:06       ` Maciej Sobczak
2007-06-28 21:19         ` Robert A Duff
2007-06-29  8:05           ` Maciej Sobczak
2007-06-29  9:42             ` Georg Bauhaus
2007-06-29 16:59               ` Adam Beneschan
2007-06-30 12:33                 ` Georg Bauhaus
2007-06-30  2:02             ` Robert A Duff
2007-06-29  8:04         ` Dmitry A. Kazakov
2007-06-27 20:02 ` Anh Vo
2007-06-27 20:48   ` Maciej Sobczak
2007-06-28  2:01     ` Robert A Duff
1990-08-27 23:48 BUS ERROR J o s e D u a r t e ! ! !
1990-08-16 14:52 saharbaugh%roo.dnet
1990-08-13 21:11 J o s e D u a r t e !!!
1990-08-10 12:32 bus error saharbaugh%roo.dnet
1990-08-09 14:50 saharbaugh%roo.dnet
1990-08-10 21:38 ` Chuck Peterson
replies disabled

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