comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Reprise: 'in out' parameters for functions
Date: Tue, 13 Apr 2004 14:00:04 +0200
Date: 2004-04-13T14:00:04+02:00	[thread overview]
Message-ID: <c5gkoq$1div2$1@ID-77047.news.uni-berlin.de> (raw)
In-Reply-To: 5ad0dd8a.0404130130.66d5e721@posting.google.com

Wojtek Narczynski wrote:

> Dimitry,
> 
> You silently refused to say what abstraction inversion is according to
> you :-)

We can use your definition if you want. (:-))

>> First of all I do not count compile time solutions for true solutions. A
>> true one would include an ability to work with dimensioned values which
>> units are unknown at compile time. A simpliest possible example is to
>> write a physicist calculator.
> 
> Then we're talking about two distinct things. I am talking about a
> compile time solution only.

Why should they be distinct? The key advantage of Ada strings as compared to
Pascal ones, is that they works in both static and dynamic cases. Why units
should be handled otherwise? How would you then mix both approaches in one
program? In my view a real solution should respond the requirements I
mentioned in another thread answering Russ.

>> OK, there are only two ways I know of, if you find a third way...
> 
> The first way can be viewed as an incarnation of the second.

Surely the second way is more general.

> Or you can ensure that there are no runtime exceptions.

I didn't say that (2) is not solvable. I just invited you to think about it
more deeply, before making some final statements. For example, one could
make the exception object mutating to its parent type, when the exception
type goes out of scope. This would then influnce the language. In which
way? What are the consequences, I mean all consequences, etc.

>> How it differs from (2)? You just replaced the official mechanism of
>> inheritance with some hard-wired other. Discriminants are just special
>> kind of members.
> 
> It differst in that it can be implemented, because there are no
> pointers to inexistent trampolines, only (immutable, integer) values.

Discriminants can be of access types.

>> This won't work. The exception out of Catch_It will be propagated *after*
>> "end Sample". So you cannot catch it here! In any point you could, the
>> type B will be already finalized. So you would have a zombie object of an
>> unexisting type.
> 
> Well, this is how it goes with exceptions. That's why the "type"
> should be limited (in ordinary sense) to only: declaration, raising /
> construction, catching and extracting immutable values in handlers.

Here you create a new class of types, limited in some particular way. Doing
so, you have to precisely define this class, you have to name it, you have
to consider types other than exceptions of being of this class, you have to
give it a formal name for generics and so on and so far. And in the end you
have to answer some newbie, why Ada does it that complex!

>> Why (1) cannot work here? The only real problem with (1) I can see, is
>> that the exception type does not have ranges or other forms of subsets.
>> One need some syntactic suggar to define a set of exceptions which could
>> be then named in "when".
> 
> Feel free to perceive my 'code' as syntactic sugar.

It is not (1) it is (2), which has a lot of problems.

-- 
Regards,
Dmitry A. Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2004-04-13 12:00 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <u4qrv5hwr.fsf@acm.org>
2004-04-08 17:19 ` Reprise: 'in out' parameters for functions Alexander E. Kopilovich
     [not found] ` <bRecOT0TxF@VB1162.spb.edu>
2004-04-08 23:46   ` Stephen Leake
2004-04-09  9:23     ` Florian Weimer
2004-04-09 10:04       ` Dmitry A. Kazakov
2004-04-09 11:23         ` Martin Krischik
2004-04-09 12:44           ` Dmitry A. Kazakov
2004-04-09 22:48             ` Randy Brukardt
2004-04-14 14:40               ` Robert I. Eachus
2004-04-14 21:20                 ` Randy Brukardt
2004-04-09 22:47         ` Florian Weimer
2004-04-10 10:49           ` Dmitry A. Kazakov
2004-04-10 11:11             ` Florian Weimer
2004-04-10 13:26               ` Dmitry A. Kazakov
2004-04-10 20:50                 ` Georg Bauhaus
2004-04-11 10:31                   ` Dmitry A. Kazakov
2004-04-09 11:27       ` Stephen Leake
2004-04-09 22:46       ` Randy Brukardt
2004-04-09 13:12     ` Wojtek Narczynski
2004-04-09 15:48       ` Expressing physical units (Was: Reprise: 'in out' parameters for functions) Jacob Sparre Andersen
2004-04-10 13:07         ` Wojtek Narczynski
2004-04-10 13:52           ` Jacob Sparre Andersen
2004-04-11  2:45             ` Hyman Rosen
2004-04-11 10:14               ` Expressing physical units Jacob Sparre Andersen
2004-04-11 16:05                 ` Hyman Rosen
2004-04-12  6:58               ` Expressing physical units (Was: Reprise: 'in out' parameters for functions) Russ
2004-04-12 10:29                 ` Dmitry A. Kazakov
2004-04-13  6:52                   ` Russ
2004-04-13 10:55                     ` Dmitry A. Kazakov
2004-04-14  4:50                       ` Hyman Rosen
2004-04-14  8:49                         ` Dmitry A. Kazakov
2004-04-14 16:49                           ` Hyman Rosen
2004-04-15 10:37                             ` Dmitry A. Kazakov
2004-04-14  7:10                       ` Russ
2004-04-14  8:53                         ` tmoran
2004-04-14  9:01                           ` Vinzent 'Gadget' Hoefler
2004-04-14  9:21                         ` Dmitry A. Kazakov
2004-04-13  9:53             ` Wojtek Narczynski
2004-04-15 21:27               ` Expressing physical units Jacob Sparre Andersen
2004-04-16 11:40                 ` Dmitry A. Kazakov
2004-04-09 16:17       ` Reprise: 'in out' parameters for functions Georg Bauhaus
2004-04-10  2:28         ` Wojtek Narczynski
2004-04-10  9:46           ` Georg Bauhaus
2004-04-10 10:49           ` Dmitry A. Kazakov
2004-04-10 15:35             ` Wojtek Narczynski
2004-04-10 21:01               ` Georg Bauhaus
2004-04-10 21:16               ` Georg Bauhaus
2004-04-11 13:20                 ` exception parameters Stephen Leake
2004-04-12 10:29                   ` Dmitry A. Kazakov
2004-04-13  0:58                     ` Stephen Leake
2004-04-13  1:30                       ` Randy Brukardt
2004-04-13  8:04                   ` Jean-Pierre Rosen
2004-04-11 10:31               ` Reprise: 'in out' parameters for functions Dmitry A. Kazakov
2004-04-12 22:02                 ` Randy Brukardt
2004-04-13 10:56                   ` Dmitry A. Kazakov
2004-04-14 21:12                     ` Randy Brukardt
2004-04-15 10:37                       ` Dmitry A. Kazakov
2004-04-13  9:30                 ` Wojtek Narczynski
2004-04-13 12:00                   ` Dmitry A. Kazakov [this message]
2004-04-13 22:41                     ` Wojtek Narczynski
2004-04-14  8:49                       ` Dmitry A. Kazakov
2004-04-14 15:03                         ` Wojtek Narczynski
2004-04-15 10:37                           ` Dmitry A. Kazakov
2004-04-16  0:29                             ` Wojtek Narczynski
2004-04-16 11:36                               ` Dmitry A. Kazakov
2004-04-16 19:25                                 ` Wojtek Narczynski
2004-04-14 15:57             ` Robert I. Eachus
2004-04-15  8:04               ` Dmitry A. Kazakov
2004-04-10 12:32           ` Wojtek Narczynski
2004-04-14 15:46           ` Robert I. Eachus
2004-04-16  1:52             ` Wojtek Narczynski
2004-04-16  5:40               ` Robert I. Eachus
2004-04-16 11:38                 ` Wojtek Narczynski
2004-04-16 16:30                   ` Robert I. Eachus
2004-04-16 18:38                   ` Randy Brukardt
2004-04-16 22:15                     ` Wojtek Narczynski
2004-04-17  1:20                       ` Robert I. Eachus
2004-04-17 11:42                         ` Wojtek Narczynski
2004-04-17 14:14                           ` Robert I. Eachus
2004-04-16 19:28                   ` Wojtek Narczynski
2004-04-09 17:09       ` Pascal Obry
2004-04-10  2:37         ` Wojtek Narczynski
     [not found] <u8yh75y33.fsf@acm.org>
2004-04-07 23:54 ` Alexander E. Kopilovich
     [not found] ` <WLZI9T09aE@VB1162.spb.edu>
2004-04-08  2:21   ` Stephen Leake
2004-04-07 20:31 Stephen Leake
2004-04-08 18:42 ` Georg Bauhaus
2004-04-08 20:32   ` Randy Brukardt
2005-01-12 15:15     ` okellogg
2005-01-12 20:14       ` Randy Brukardt
2004-04-08 23:48   ` Stephen Leake
2004-04-13 14:45 ` Robert I. Eachus
replies disabled

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