comp.lang.ada
 help / color / mirror / Atom feed
From: dmytrylavrov@fsmail.net (Dmytry Lavrov)
Subject: Re: How to test object hierarchy
Date: 21 Dec 2003 11:58:00 -0800
Date: 2003-12-21T11:58:00-08:00	[thread overview]
Message-ID: <49cbf610.0312211158.87338af@posting.google.com> (raw)
In-Reply-To: bs47m5$9e9ea$2@ID-77047.news.uni-berlin.de

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message news:<bs47m5$9e9ea$2@ID-77047.news.uni-berlin.de>...
<snip> 
> 
> I think that IF Ada should have multiple dispatch on different types

Wao.That's exactly(multiple dispatch) that i tried to explain to
peoples(very experienced and probably smart too ) who know only
"object.method" notation.
Of course that failed(they even can't understand what it is it),
because that damn "."(like fields in record) left place only for one
object!

i got probably good(and also wild) idea that
method(paramether,paramether,...) are shugar for
method(composed_class_constructor(paramether1,paramether2,...) )

and if thete's multiple inheritance, it's 
method(temporary_child_class_constructor(parent1,parent2,...) );

and also about that it's shugar for
dispatch(in paramether1[, in paramether2....]).method(in out
paramether1[,in out paramether2....]);
- it can be implemented without changing the language at all,but need
lots of stupid work with "procedural variables".

Maybe that could give someone here any good idea.

(it was about problem with overloading math operators for classes-
double dispathing was required - different methods for matrix by
matrix,matrix by scalar,matrix by vector,vector by matrix,etc,in all
combinations including complex number stuff ,etc. )


> then
> inevitably we should reconsider the freezing rules. The most useful
> implementations of MD appear when types are defined in different packages.
> The rationale behind the existing freezing rules is to prevent dispatching
> to non-elaborated targets. I believe that for a MD operation the freezing
> point could be the last freezing point of all involved types. For example:
> 
> package Devices is
>    type Device is tagged ...;
>    procedure Load (X : in out Device);
> end Device; -- No more primitive operations with only Device
> 
> with Devices; use Devices;
> package Curves is
>    type Curve is tagged ...;
>    procedure Show (X : in out Device; Y : Curve);
> end Curves; -- No more operations with Device and Curve
> 
> It is clear that these rules can be very dangerous, if we will not limit use
> of non-primitive operations (except the class-wide ones). The first step
> could be to make all types "tagged". But even this could be not enough.

Main problem that compiler will no longer detect some errors,right?

Regards,

Dmytry Lavrov.



  reply	other threads:[~2003-12-21 19:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-18 18:24 How to test object hierarchy Pierre Favier
2003-12-19  0:15 ` Stephen Leake
2003-12-19  7:45   ` Pierre Favier
2003-12-19 10:53 ` Dmitry A. Kazakov
2003-12-19 14:35   ` Hyman Rosen
2003-12-19 17:07     ` Dmitry A. Kazakov
2003-12-19 23:26     ` Robert A Duff
2003-12-20 18:20       ` Robert I. Eachus
2003-12-19 17:25   ` Georg Bauhaus
2003-12-20 11:13     ` Dmitry A. Kazakov
2003-12-21  4:34       ` Georg Bauhaus
2003-12-21 13:43         ` Dmitry A. Kazakov
2003-12-21 19:58           ` Dmytry Lavrov [this message]
2003-12-22  1:19             ` Robert I. Eachus
2003-12-22 10:09               ` Dmitry A. Kazakov
2003-12-22 17:33                 ` Robert I. Eachus
2003-12-23 10:49                   ` Dmitry A. Kazakov
2003-12-22 10:05             ` Dmitry A. Kazakov
2003-12-19 17:24 ` Nick Roberts
replies disabled

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