comp.lang.ada
 help / color / mirror / Atom feed
From: ytomino <aghia05@gmail.com>
Subject: Re: Class wide preconditions: error in GNAT implementation?
Date: Sun, 17 Feb 2013 07:12:22 -0800 (PST)
Date: 2013-02-17T07:12:22-08:00	[thread overview]
Message-ID: <76e9fde1-3cbb-47e0-b578-b7b9be3ff9c6@googlegroups.com> (raw)
In-Reply-To: <lyhalcqa7v.fsf@pushface.org>

I am not aware of the intention of the writer of AARM (Randy?).
Though as far as I read AARM and compare it with the Eiffel book,

>      O := new B_Pack.T; 
>      Put_Line ("passing 0 to an actual B_Pack.T"); 
>      O.P (0); 

Calling B_Pack.P via access A_Pack.T'Class should be failure.

6.6.1.38.a/3:

> Pre'Class(es) that apply to the subprogram that the dispatching call
> is resolving to, not the Pre'Class(es) for the subprogram that is
> ultimately dispatched to. 

"resolving to" = A_Pack.P
"dispatched to" = B_Pack.P

And, this rule is correspond to page 575 of
"Object-Oriented Software Construction 2/E". It indicates that
the caller (client) of A_Pack.T('Class) has only contract with A_Pack.T.
If the caller want to use weaker contract, the caller should become 
a direct client of B_Pack.T.

The photo of this page has been uploaded in the discussion of dmd:
http://d.puremagic.com/issues/show_bug.cgi?id=6857#c84



  reply	other threads:[~2013-02-17 15:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15  3:55 Class wide preconditions: error in GNAT implementation? ytomino
2013-02-15 10:15 ` Georg Bauhaus
2013-02-15 13:16   ` ytomino
2013-02-16  1:01 ` Randy Brukardt
2013-02-16  2:50   ` ytomino
2013-02-16  9:28     ` Dmitry A. Kazakov
2013-02-16 13:13       ` ytomino
2013-02-16 16:35         ` Dmitry A. Kazakov
2013-02-16 19:55           ` ytomino
2013-02-16 20:34             ` ytomino
2013-02-18  8:30             ` Dmitry A. Kazakov
2013-02-18  9:17               ` Simon Wright
2013-02-18 14:25                 ` Dmitry A. Kazakov
2013-02-18 18:04                   ` Simon Wright
2013-02-18 19:27                     ` Dmitry A. Kazakov
2013-02-18 20:42                       ` Simon Wright
2013-02-19  9:07                         ` Dmitry A. Kazakov
2013-02-18 19:02               ` ytomino
2013-02-18 19:44                 ` Dmitry A. Kazakov
2013-02-16 15:16       ` Georg Bauhaus
2013-02-16 20:23   ` Simon Wright
2013-02-17 15:12     ` ytomino [this message]
2013-02-18 17:49       ` Simon Wright
2013-02-18 18:45         ` ytomino
replies disabled

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